7
7
#AutoIt3Wrapper_Res_Comment= https:// www.msedgeredirect.com
8
8
#AutoIt3Wrapper_Res_CompanyName= Robert Maehl Software
9
9
#AutoIt3Wrapper_Res_Description= MSEdgeRedirect
10
- #AutoIt3Wrapper_Res_Fileversion= 0.7.4 .0
10
+ #AutoIt3Wrapper_Res_Fileversion= 0.7.5 .0
11
11
#AutoIt3Wrapper_Res_ProductName= MSEdgeRedirect App & Service
12
- #AutoIt3Wrapper_Res_ProductVersion= 0.7.4 .0
12
+ #AutoIt3Wrapper_Res_ProductVersion= 0.7.5 .0
13
13
#AutoIt3Wrapper_Res_LegalCopyright= Robert Maehl, using LGPL 3 License
14
14
#AutoIt3Wrapper_Res_Language= 1033
15
15
#AutoIt3Wrapper_Res_requestedExecutionLevel= asInvoker
@@ -142,29 +142,34 @@ Func FixTreeIntegrity($aCMDLine)
142
142
143
143
Local $iParent = _WinAPI_GetParentProcess()
144
144
145
- If _WinAPI_GetProcessName($iParent ) = " MSEdge.exe" Then
145
+ Switch _WinAPI_GetProcessName($iParent )
146
+
147
+ Case " MSEdge.exe"
146
148
147
- FileWrite ($hLogs [$AppGeneral ], _NowCalc() & " - " & " Caught MSEdge Parent Process, Launched by " & _WinAPI_GetProcessName(_WinAPI_GetParentProcess($iParent )) & " , Grabbing Parameters." & @CRLF )
149
+ FileWrite ($hLogs [$AppGeneral ], _NowCalc() & " - " & " Caught MSEdge Parent Process, Launched by " & _WinAPI_GetProcessName(_WinAPI_GetParentProcess($iParent )) & " , Grabbing Parameters." & @CRLF )
148
150
149
- Local $aAdjust
151
+ Local $aAdjust
150
152
151
- ; Enable "SeDebugPrivilege" privilege for obtain full access rights to another processes
152
- Local $hToken = _WinAPI_OpenProcessToken(BitOR ($TOKEN_ADJUST_PRIVILEGES , $TOKEN_QUERY ))
153
+ ; Enable "SeDebugPrivilege" privilege for obtain full access rights to another processes
154
+ Local $hToken = _WinAPI_OpenProcessToken(BitOR ($TOKEN_ADJUST_PRIVILEGES , $TOKEN_QUERY ))
153
155
154
- _WinAPI_AdjustTokenPrivileges($hToken , $SE_DEBUG_NAME , $SE_PRIVILEGE_ENABLED , $aAdjust )
156
+ _WinAPI_AdjustTokenPrivileges($hToken , $SE_DEBUG_NAME , $SE_PRIVILEGE_ENABLED , $aAdjust )
155
157
156
- Redim $aCMDLine [2 ]
157
- $aCMDLine [0 ] = 0
158
- $aCMDLine [1 ] = _WinAPI_GetProcessFileName($iParent )
158
+ Redim $aCMDLine [2 ]
159
+ $aCMDLine [0 ] = 0
160
+ $aCMDLine [1 ] = _WinAPI_GetProcessFileName($iParent )
159
161
160
- _ArrayConcatenate($aCMDLine , StringSplit (_WinAPI_GetProcessCommandLine($iParent ), " " , $STR_NOCOUNT ))
162
+ _ArrayConcatenate($aCMDLine , StringSplit (_WinAPI_GetProcessCommandLine($iParent ), " " , $STR_NOCOUNT ))
161
163
162
- $aCMDLine [0 ] = UBound ($aCMDLine ) - 1
164
+ $aCMDLine [0 ] = UBound ($aCMDLine ) - 1
163
165
164
- ProcessClose ($iParent )
166
+ ProcessClose ($iParent )
165
167
166
- EndIf
168
+ Case " MSEdgeRedirect.exe"
169
+
170
+ _SafeRun(StringReplace ($aEdges [1 ], " msedge.exe" , " msedge_IFEO.exe" ), $aCMDLine [3 ])
167
171
172
+ EndSwitch
168
173
Return $aCMDLine
169
174
170
175
EndFunc
@@ -176,6 +181,7 @@ Func ProcessCMDLine()
176
181
Local $aPIDs
177
182
Local $bHide = _GetSettingValue(" NoTray" )
178
183
Local $hFile = @ScriptDir & " .\Setup.ini"
184
+ Local $bForce = False
179
185
Local $iParams = $CmdLine [0 ]
180
186
Local $sCMDLine = _ArrayToString($CmdLine , " " , 1 )
181
187
Local $bSilent = False
@@ -189,7 +195,6 @@ Func ProcessCMDLine()
189
195
$CMDLine = RepairCMDLine($CMDLine )
190
196
191
197
If _ArraySearch($aEdges , $CMDLine [1 ]) > 0 Then ; Image File Execution Options Mode
192
- RunHTTPCheck()
193
198
ActiveMode($CMDLine )
194
199
If Not _GetSettingValue(" NoUpdates" ) And Random (1 , 10 , 1 ) = 1 Then RunUpdateCheck()
195
200
Exit
@@ -204,6 +209,7 @@ Func ProcessCMDLine()
204
209
@TAB & " /admin " & @TAB & " Attempts to run MSEdgeRedirect as admin" & @CRLF & _
205
210
@TAB & " /change " & @TAB & " Reruns Installer" & @CRLF & _
206
211
@TAB & " /hide " & @TAB & " Hides the tray icon" & @CRLF & _
212
+ @TAB & " /force " & @TAB & " Skips Safety Checks" & @CRLF & _
207
213
@TAB & " /kill " & @TAB & " Kills other MSEdgeRedirect processes" & @CRLF & _
208
214
@TAB & " /portable " & @TAB & " Runs MSEdgeRedirect in portable mode" & @CRLF & _
209
215
@TAB & " /repair " & @TAB & " Repairs IFEO directory junctions" & @CRLF & _
@@ -224,6 +230,9 @@ Func ProcessCMDLine()
224
230
Case " /change"
225
231
RunSetup(True , $bSilent , 1 )
226
232
Exit
233
+ Case " /f" , " /force"
234
+ $bForce = True
235
+ _ArrayDelete($CmdLine , 1 )
227
236
Case " /h" , " /hide"
228
237
$bHide = True
229
238
_ArrayDelete($CmdLine , 1 )
@@ -316,9 +325,10 @@ Func ProcessCMDLine()
316
325
317
326
If $hFile = " WINGET" Then
318
327
; ;;
319
- Else
328
+ ElseIf Not $bForce Then
320
329
RunArchCheck($bSilent )
321
- RunHTTPCheck($bSilent )
330
+ Else
331
+ ; ;;
322
332
EndIf
323
333
324
334
If Not $bPortable Then
@@ -371,6 +381,7 @@ Func ProcessCMDLine()
371
381
RunSetup(True , $bSilent , 0 , $hFile )
372
382
EndSelect
373
383
EndIf
384
+ RunHTTPCheck()
374
385
ReactiveMode($bHide )
375
386
376
387
EndFunc
@@ -540,7 +551,7 @@ Func _DecodeAndRun($sEdge = $aEdges[1], $sCMDLine = "")
540
551
$sCMDLine = StringReplace ($sCMDLine , " --single-argument " , " " )
541
552
Switch _GetSettingValue(" PDFApp" )
542
553
Case " Default"
543
- If RunPDFCheck() And _IsSafePDF($sCMDLine ) Then ShellExecute ($sCMDLine )
554
+ If RunPDFCheck() And _IsSafePDF($sCMDLine ) Then ShellExecute (' " ' & $sCMDLine & ' " ' )
544
555
Case Else
545
556
ShellExecute (_GetSettingValue(" PDFApp" ), ' "' & $sCMDLine & ' "' )
546
557
EndSwitch
@@ -568,49 +579,34 @@ Func _DecodeAndRun($sEdge = $aEdges[1], $sCMDLine = "")
568
579
Case Else
569
580
FileWrite ($hLogs [$URIFailures ], _NowCalc() & " - Invalid App URL: " & $sCMDLine & @CRLF )
570
581
EndSelect
571
- Case StringInStr ($sCMDLine , " bing.com/chat" ) ; Fix BingAI
572
- If _GetSettingValue(" NoPDFs" ) Then _SafeRun($sEdge , $sCMDLine )
573
- Case StringInStr ($sCMDLine , " &url=" ) ; Fix Windows 11 Widgets
574
- ContinueCase
575
- Case StringInStr ($sCMDLine , " --edge-redirect" )
576
- $aCMDLine = _RedirectCMDDecode($sCMDLine )
577
-
578
- For $iLoop = 0 To Ubound ($aCMDLine ) - 1 Step 1
579
- If $aCMDLine [$iLoop ][0 ] = " url" Then
580
- $sURL = $aCMDLine [$iLoop ][1 ]
581
- If StringInStr ($sURL , " %2F" ) Then $sURL = _WinAPI_UrlUnescape($sURL )
582
- ExitLoop
583
- EndIf
584
- Next
585
-
586
- If $sURL = " " Then
587
- FileWrite ($hLogs [$URIFailures ], _NowCalc() & " - Command Line Missing Needed Parameters: " & $sCMDLine & @CRLF )
582
+ Case StringInStr ($sCMDLine , " bing.com/chat" ) Or StringInStr ($sCMDLine , " bing.com%2Fchat" ) ; Fix BingAI
583
+ If _GetSettingValue(" NoChat" ) Then
584
+ ; ;;
588
585
Else
589
- FileWrite ( $hLogs [ $AppGeneral ], _NowCalc() & " - Caught 'Edge-Redirect' Call: " & @CRLF & _ArrayToString( $aCMDLine , " : " ) & @CRLF )
590
- If _IsSafeURL( $sURL ) Then
591
- $sURL = _ModifyURL( $sURL )
592
- ShellExecute ( $sURL )
593
- Else
594
- FileWrite ( $hLogs [ $URIFailures ], _NowCalc() & " - Invalid URL: " & $sCMDLine & @CRLF )
595
- EndIf
586
+ _SafeRun( $sEdge , $sCMDLine )
587
+ EndIf
588
+ Case StringInStr ( $sCMDLine , " ux=copilot " )
589
+ If _GetSettingValue( " NoPilot " ) Then
590
+ ShellExecute ( " ms-settings: " )
591
+ Else
592
+ _SafeRun( $sEdge , $sCMDLine )
596
593
EndIf
594
+ Case StringInStr ($sCMDLine , " &url=" ) ; Fix Windows 11 Widgets
595
+ ContinueCase
597
596
Case StringInStr ($sCMDLine , " microsoft-edge:" )
598
- If Not StringInStr ($sCMDLine , " url=" ) Then $sCMDLine = StringRegExpReplace ($sCMDLine , " microsoft-edge:[\/]*" , " microsoft-edge:?url=" )
599
-
600
- $aCMDLine = _RedirectCMDDecode($sCMDLine )
597
+ $aCMDLine = _CMDLineDecode($sCMDLine )
601
598
602
599
For $iLoop = 0 To Ubound ($aCMDLine ) - 1 Step 1
603
600
If $aCMDLine [$iLoop ][0 ] = " url" Then
604
- $sURL = $aCMDLine [$iLoop ][1 ]
605
- If StringInStr ($sURL , " %2F" ) Then $sURL = _WinAPI_UrlUnescape($sURL )
601
+ $sURL = $aCMDLine [$iLoop ][1 ]
606
602
ExitLoop
607
603
EndIf
608
604
Next
609
605
610
606
If $sURL = " " Then
611
607
FileWrite ($hLogs [$URIFailures ], _NowCalc() & " - Command Line Missing Needed Parameters: " & $sCMDLine & @CRLF )
612
608
Else
613
- FileWrite ($hLogs [$AppGeneral ], _NowCalc() & " - Caught 'Microsoft-Edge' Call:" & @CRLF & _ArrayToString($aCMDLine , " : " ) & @CRLF )
609
+ FileWrite ($hLogs [$AppGeneral ], _NowCalc() & " - Caught Valid URI Call:" & @CRLF & _ArrayToString($aCMDLine , " : " ) & @CRLF )
614
610
If _IsSafeURL($sURL ) Then
615
611
$sURL = _ModifyURL($sURL )
616
612
ShellExecute ($sURL )
0 commit comments