-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
innosetup: fix invalid drive error with missing installs
When the innosetup app path in the registry points to an invalid location, like a drive which no longer exists, setup breaks because it is unable to install to the location, but also the uninstaller no longer exists too and so it can't be uninstalled. This forces the user to fix it via editing the registry. This could be worked around with DisableDirPage=no, which always forces the dir page to be shown. But this would allow users to install multiple times to different places, which is not desirable. Reset the dir path if it is pointed to a non-default location which doesn't exist. Note the dir page is still not shown in this case, but at least it will fix the install enough to let the user uninstall it again if they want to move it to a different location.
- Loading branch information
Showing
4 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
procedure InitializeWizard(); | ||
var | ||
defaultPath: String; | ||
currentPath: String; | ||
begin | ||
defaultPath := ExpandConstant('{localappdata}\RuneLite'); | ||
{ this defaults to the current installed location read from the registry } | ||
currentPath := GetWizardForm.DirEdit.Text; | ||
if defaultPath <> currentPath then begin | ||
if not DirExists(currentPath) then begin | ||
{ Already installed to a non-default location which doesn't exist. | ||
It is not possible to make the installer reenable the dir page here, | ||
but we can at least reset the install location. } | ||
Log(Format('Resetting diredit path to %s', [defaultPath])) | ||
GetWizardForm.DirEdit.Text := defaultPath | ||
end | ||
end | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters