Skip to content

Commit 028c702

Browse files
committed
- Run clean-up after error
- Fix FileMove for .pbak files
1 parent d84dda8 commit 028c702

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

LibreWolf-Portable.ahk

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ ReplacePaths(FilePath, LibreWolfPathUri, ProfilePathUri, OverridesPath = False)
231231
If (File = FileOrg)
232232
Return False
233233
Else {
234-
FileMove, %FilePath%, %ProfilePath%\%FilePath%.pbak, 1
234+
FileMove, %FilePath%, %FilePath%.pbak, 1
235235
If (ErrorLevel)
236236
Die(_FileWriteError, FilePath ".pbak")
237237
FileAppend, %File%, %FilePath%
@@ -315,6 +315,13 @@ ProcessRunning(Where := "") {
315315
Return False
316316
}
317317

318+
Die(Error, Var := False) {
319+
If (Var)
320+
Error := StrReplace(Error, "{}", Var)
321+
MsgBox, 48, %_Title%, %Error%
322+
CleanUp()
323+
}
324+
318325
CleanUp() {
319326
; Wait until all launcher instances are closed before restoring backed up registry key
320327
If (RegBackedUp And OtherLauncherRunning())
@@ -356,13 +363,6 @@ CleanUp() {
356363
Exit()
357364
}
358365

359-
Die(Error, Var := False) {
360-
If (Var)
361-
Error := StrReplace(Error, "{}", Var)
362-
MsgBox, 48, %_Title%, %Error%
363-
Exit()
364-
}
365-
366366
Exit() {
367367
ExitApp
368368
}

0 commit comments

Comments
 (0)