Skip to content

Commit 6b42d32

Browse files
Update AltLauncher.au3
Fixed an issue where files were not saved to backup folder if $SafeMode was not True. Fixed $SafeMode logic for Files.
1 parent b12a2cb commit 6b42d32

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

AltLauncher.au3

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#AutoIt3Wrapper_Icon=Resources\AltLauncher.ico
33
#AutoIt3Wrapper_Outfile=Build\AltLauncher.exe
44
#AutoIt3Wrapper_UseX64=n
5-
#AutoIt3Wrapper_Res_Fileversion=0.2.1.2
5+
#AutoIt3Wrapper_Res_Fileversion=0.2.1.3
66
#AutoIt3Wrapper_Res_Language=1033
77
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
88
#include <Constants.au3>
@@ -431,15 +431,15 @@ Func Manage_File($Mode, ByRef $Files, ByRef $i)
431431
FileMove($FilePath, $FilePath & '.AltLauncher-Backup', $FC_OVERWRITE + $FC_CREATEPATH)
432432
FileCopy($BackupPath, $FilePath, $FC_OVERWRITE + $FC_CREATEPATH)
433433
Case "Restore"
434-
If $SafeMode = "true" Then
435-
FileMove($FilePath, $BackupPath, $FC_OVERWRITE + $FC_CREATEPATH)
436-
Else
437-
If $SafeMode = "False" Then
438-
FileDelete($BackupPath)
439-
Else
440-
FileRecycle($BackupPath)
441-
EndIf
442-
EndIf
434+
$FileExists = FileExists($FilePath)
435+
FileMove($FilePath, $BackupPath, $FC_OVERWRITE + $FC_CREATEPATH)
436+
Switch $SafeMode
437+
Case "True"
438+
If Not $FileExists Then FileRecycle($BackupPath)
439+
Case "False"
440+
If Not $FileExists Then FileDelete($BackupPath)
441+
Case Null
442+
EndSwitch
443443
FileMove($FilePath & '.AltLauncher-Backup', $FilePath, $FC_OVERWRITE + $FC_CREATEPATH)
444444
EndSwitch
445445
EndFunc ;==>Manage_File

0 commit comments

Comments
 (0)