Skip to content

Commit fb3e7aa

Browse files
authored
Merge pull request #21 from mlipok/patch-3
Update Unregister.au3
2 parents b694369 + ba9d83a commit fb3e7aa

1 file changed

Lines changed: 28 additions & 17 deletions

File tree

bin/Unregister.au3

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,36 @@
11
#RequireAdmin
2+
#AutoIt3Wrapper_Run_AU3Check=Y
3+
#AutoIt3Wrapper_AU3Check_Stop_OnWarning=y
4+
#AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
5+
#Tidy_Parameters=/reel
6+
27
#include <MsgBoxConstants.au3>
38

4-
; === Configuration ===
5-
Local $sDllName = "NetWebView2Lib.dll"
6-
Local $sTlbName = "NetWebView2Lib.tlb"
7-
Local $sNet4_x86 = "C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe"
8-
Local $sNet4_x64 = "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe"
9+
_Unregister()
10+
11+
Func _Unregister()
12+
; === Configuration ===
13+
Local $sDllName = "NetWebView2Lib.dll"
14+
Local $sTlbName = "NetWebView2Lib.tlb"
15+
#forceref $sTlbName
916

10-
Local $sLog = "Unregistration Report:" & @CRLF & "----------------------" & @CRLF
17+
Local $sNet4_x86 = "C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe"
18+
Local $sNet4_x64 = "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe"
1119

12-
; === Unregister x86 ===
13-
If FileExists($sNet4_x86) Then
14-
Local $iExitCode = RunWait('"' & $sNet4_x86 & '" /u "' & @ScriptDir & '\' & $sDllName & '"', @ScriptDir, @SW_HIDE)
15-
$sLog &= ($iExitCode = 0 ? "[+] x86 Unregistration: SUCCESS" : "[-] x86 Unregistration: FAILED") & @CRLF
16-
EndIf
20+
Local $sLog = "Unregistration Report:" & @CRLF & "----------------------" & @CRLF
21+
Local $iExitCode
1722

18-
; === Unregister x64 ===
19-
If FileExists($sNet4_x64) Then
20-
Local $iExitCode = RunWait('"' & $sNet4_x64 & '" /u "' & @ScriptDir & '\' & $sDllName & '"', @ScriptDir, @SW_HIDE)
21-
$sLog &= ($iExitCode = 0 ? "[+] x64 Unregistration: SUCCESS" : "[-] x64 Unregistration: FAILED") & @CRLF
22-
EndIf
23+
; === Unregister x86 ===
24+
If FileExists($sNet4_x86) Then
25+
$iExitCode = RunWait('"' & $sNet4_x86 & '" /u "' & @ScriptDir & '\' & $sDllName & '"', @ScriptDir, @SW_HIDE)
26+
$sLog &= ($iExitCode = 0 ? "[+] x86 Unregistration: SUCCESS" : "[-] x86 Unregistration: FAILED") & @CRLF
27+
EndIf
2328

29+
; === Unregister x64 ===
30+
If FileExists($sNet4_x64) Then
31+
$iExitCode = RunWait('"' & $sNet4_x64 & '" /u "' & @ScriptDir & '\' & $sDllName & '"', @ScriptDir, @SW_HIDE)
32+
$sLog &= ($iExitCode = 0 ? "[+] x64 Unregistration: SUCCESS" : "[-] x64 Unregistration: FAILED") & @CRLF
33+
EndIf
2434

25-
MsgBox($MB_ICONINFORMATION, "Cleanup Complete", $sLog)
35+
MsgBox($MB_ICONINFORMATION, "Unregistration process completed", $sLog)
36+
EndFunc ;==>_Unregister

0 commit comments

Comments
 (0)