-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathUninstall.au3
170 lines (128 loc) · 5.11 KB
/
Uninstall.au3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#NoTrayIcon
#RequireAdmin
#include <AutoItConstants.au3>
#include <FileConstants.au3>
#include "includes\ExtMsgBox.au3"
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=firefox.ico
#AutoIt3Wrapper_Res_Icon_Add=firefox.ico
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Res_Description=SandboxYourFox Uninstaller
#AutoIt3Wrapper_Res_Fileversion=135.0.0
#AutoIt3Wrapper_Res_ProductVersion=135.0.0
#AutoIt3Wrapper_Res_ProductName=SandboxYourFox
#AutoIt3Wrapper_Res_LegalCopyright=@ 2025 WildByDesign
#AutoIt3Wrapper_Res_Language=1033
#AutoIt3Wrapper_Res_HiDpi=P
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
If $CmdLine[0] = 0 Then
InstallStep2()
EndIf
Func InstallStep2()
; C:\Users\user-name\AppData\Local\Temp\SandboxYourFox\Uninstall.exe
Local $quote1 = '"'
Local $tempdir1 = @HomeDrive
Local $tempdir2 = '\Users\'
Local $tempdir3 = @UserName
Local $tempdir4 = '\AppData\Local\Temp\SandboxYourFox\Uninstall.exe'
Local $quote2 = '"'
Local $tempdir5 = ' uninstall'
FileCopy(@ScriptDir & "\Uninstall.exe", @TempDir & "\SandboxYourFox\Uninstall.exe", $FC_OVERWRITE + $FC_CREATEPATH)
Run($quote1 & $tempdir1 & $tempdir2 & $tempdir3 & $tempdir4 & $quote2 & $tempdir5, "")
;MsgBox($MB_SYSTEMMODAL, "Title", $tempdir1 & $tempdir2 & $tempdir3 & $tempdir4 & $tempdir5)
Exit
EndFunc
If $CmdLine[1] = "uninstall" Then
EndIf
Global $isDarkMode = is_app_dark_theme()
;MsgBox($MB_SYSTEMMODAL, "Title", $isDarkMode)
If $isDarkMode = True Then
;MsgBox($MB_SYSTEMMODAL, "Title", "We are in Dark Mode!")
Global $DarkMode = _ExtMsgBoxSet(-1, 4, 0x202020, 0xFFFFFF, -1, -1, 800)
;$sMsg = 'We are in Dark Mode!'
;$iRetValue = _ExtMsgBox (0, 0, "Dark Mode", $sMsg)
Else
;MsgBox($MB_SYSTEMMODAL, "Title", "We are in Light Mode!")
Global $LightMode = _ExtMsgBoxSet(-1, 4, -1, -1, -1, -1, 800)
;$sMsg = 'We are in Light Mode!'
;$iRetValue = _ExtMsgBox (0, 0, "Light Mode", $sMsg)
EndIf
#cs ----------------------------------------------------------------------------
Function : is_app_dark_theme()
Description : returns if the user has enabled the dark theme for applications in the Windows settings (0 on / 1 off)
if OS too old (key does not exist) the key returns nothing, so function returns False
#ce ----------------------------------------------------------------------------
func is_app_dark_theme()
return(regread('HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize', 'AppsUseLightTheme') == 0) ? True : False
endfunc
FirefoxRunning()
Func FirefoxRunning()
If ProcessExists("firefox.exe") Then
; _ExtMsgBoxSet(-1, 4, -1, -1, -1, -1, 800)
$sMsg = " Firefox is currently running. Please close Firefox and run the uninstaller again. " & @CRLF
$iRetValue = _ExtMsgBox (0, 0, "SandboxYourFox Uninstaller", $sMsg)
Exit
EndIf
EndFunc
RemoveInstall()
Func RemoveInstall()
;_ExtMsgBoxSet(-1, -1, -1, -1, -1, -1, 800)
$sMsg = " SandboxYourFox Location:" & @CRLF
$sMsg &= " " & @ProgramFilesDir & "\SandboxYourFox " & @CRLF & @CRLF
$sMsg &= " " & @CRLF
$sMsg &= " This will remove SandboxYourFox from the above location. Would you like to continue? " & @CRLF
$iRetValue = _ExtMsgBox (0, 4, "SandboxYourFox Uninstaller", $sMsg)
If $iRetValue = 1 Then
ConsoleWrite("Yes" & @CRLF)
ElseIf $iRetValue = 2 Then
; _ExtMsgBoxSet(-1, 4, -1, -1, -1, -1, 800)
$sMsg2 = " SandboxYourFox uninstall has been cancelled. " & @CRLF
$iRetValue2 = _ExtMsgBox (0, 0, "SandboxYourFox Uninstaller", $sMsg2)
Exit
EndIf
EndFunc
DeleteDir()
Func DeleteDir()
Local Const $sFilePath = @ProgramFilesDir & "\SandboxYourFox"
If FileExists($sFilePath) Then
DirRemove($sFilePath, $DIR_REMOVE)
EndIf
EndFunc
DeleteShortcut()
Func DeleteShortcut()
Local Const $sFilePath = @DesktopDir & "\SandboxYourFox.lnk"
Local $iDelete = FileDelete($sFilePath)
EndFunc
RemoveMitigations()
Func RemoveMitigations()
RegDelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\firefox.exe")
EndFunc
RemoveProfile()
Func RemoveProfile()
;_ExtMsgBoxSet(-1, -1, -1, -1, -1, -1, 800)
$sMsg = " Profile Location:" & @CRLF
$sMsg &= " " & @LocalAppDataDir & "\Packages\appcontainer.launcher\AC\Profile " & @CRLF & @CRLF
$sMsg &= " " & @CRLF
$sMsg &= " This will remove your SandboxYourFox Profile from the above location. Would you like to continue? " & @CRLF
$iRetValue = _ExtMsgBox (0, 4, "SandboxYourFox Uninstaller", $sMsg)
If $iRetValue = 1 Then
ConsoleWrite("Yes" & @CRLF)
ElseIf $iRetValue = 2 Then
InstallComplete()
Exit
EndIf
EndFunc
DeleteProfileDir()
Func DeleteProfileDir()
Local Const $sFilePath = @LocalAppDataDir & "\Packages\appcontainer.launcher"
If FileExists($sFilePath) Then
DirRemove($sFilePath, $DIR_REMOVE)
EndIf
EndFunc
InstallComplete()
Func InstallComplete()
;_ExtMsgBoxSet(-1, 4, -1, -1, -1, -1, 800)
$sMsg = " SandboxYourFox has been successfully uninstalled. " & @CRLF
$iRetValue = _ExtMsgBox (0, 0, "SandboxYourFox Uninstaller", $sMsg)
EndFunc
Exit