Skip to content

Commit

Permalink
- Fix ignoring the custom path set in the .ini
Browse files Browse the repository at this point in the history
- Exit app immediately on Cancel in file selection dialog
  • Loading branch information
ltguillaume committed Aug 5, 2023
1 parent 859d714 commit 41243d7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions LibreWolf-WinUpdater.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,11 @@ CheckPaths() {
Path := A_ScriptDir "\LibreWolf\librewolf.exe"
Else {
IniRead, Path, %IniFile%, Settings, Path, 0 ; Need to use 0, because False would become a string
If (!Path)
If (!Path) {
RegRead, Path, HKLM\SOFTWARE\Clients\StartMenuInternet\LibreWolf\shell\open\command
If (ErrorLevel)
Path = %ProgramW6432%\LibreWolf\%LibreWolfExe%
If (ErrorLevel)
Path = %ProgramW6432%\LibreWolf\%LibreWolfExe%
}

Path := Trim(Path, """") ; FileExist chokes on double quotes
If (!FileExist(Path))
Expand All @@ -179,7 +180,7 @@ CheckPaths() {
MsgBox, 48, %_Updater%, %_GetPathError%
FileSelectFile, Path, 3, %Path%, %_SelectFileTitle%, %LibreWolfExe%
If (ErrorLevel)
Exit()
ExitApp
Else {
IniWrite, %Path%, %IniFile%, Settings, Path
Goto, CheckPath
Expand Down

0 comments on commit 41243d7

Please sign in to comment.