Skip to content

Commit 78e667f

Browse files
committed
Add pre-0.7.2.0 detection. Add more exit codes
1 parent 15e86f8 commit 78e667f

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

MSEdgeRedirect.au3

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,15 @@ Func ProcessCMDLine()
201201
$aInstall = _IsInstalled()
202202
If DriveGetType(@ScriptDir) = "Removable" And FileExists(".\Settings.ini") Then _GetSettingValue("SetPortable")
203203

204+
If $aInstall[0] And StringReplace($aInstall[2], ".", "") <= "0720" Then
205+
MsgBox($MB_ICONERROR+$MB_OK, _
206+
_Translate($aMUI[1], "Legacy Install Detected"), _
207+
_Translate($aMUI[1], "Please Uninstall Existing MSEdgeRedirect before Upgrading"))
208+
_Log($hLogs[$AppFailures], "" & "Pre-0.7.2.0 version detected. Unable to clean up task scheduler entries." & @CRLF)
209+
_LogClose()
210+
Exit 10 ; ERROR_BAD_ENVIRONMENT
211+
EndIf
212+
204213
If $iParams > 0 Then
205214

206215
$CMDLine = RepairCMDLine($CMDLine)
@@ -253,7 +262,7 @@ Func ProcessCMDLine()
253262
_Translate($aMUI[1], "Unable to install Active Mode without Admin Rights!"))
254263
_Log($hLogs[$AppFailures], "" & "Active Mode UAC Elevation Attempt Failed!" & @CRLF)
255264
_LogClose()
256-
Exit
265+
Exit 5 ; ERROR_ACCESS_DENIED
257266
Else
258267
RunSetup($aInstall[0], False, -2)
259268
EndIf
@@ -265,7 +274,7 @@ Func ProcessCMDLine()
265274
_Translate($aMUI[1], "Unable to Setup Europe Mode without Admin Rights!"))
266275
_Log($hLogs[$AppFailures], "" & "Europe Mode UAC Elevation Attempt Failed!" & @CRLF)
267276
_LogClose()
268-
Exit
277+
Exit 5 ; ERROR_ACCESS_DENIED
269278
Case Not RegRead("HKLM\SYSTEM\CurrentControlSet\Services\UCPD", "Start") = 4
270279
ContinueCase
271280
Case Not RegRead("HKLM\SYSTEM\CurrentControlSet\Services\UCPD", "FeatureV2") = 0

0 commit comments

Comments
 (0)