Skip to content

Commit

Permalink
Update InnoSetup version
Browse files Browse the repository at this point in the history
Improve handling around missing uninstaller & uninstall registry key. Currently, the install over a corrupted install will fail and is blocked because of an error raised when getting uninstaller registry key that no longer exists.
  • Loading branch information
bclothier committed Oct 2, 2020
1 parent 8695c05 commit 40cbfa4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
22 changes: 16 additions & 6 deletions Rubberduck.Deployment/InnoSetup/Rubberduck.Installer.Build.iss
Expand Up @@ -252,7 +252,7 @@ function ShellExecute(hwnd: HWND; lpOperation: string; lpFile: string;
///</remarks>
function IsElevated: Boolean;
begin
Result := IsAdminLoggedOn;
Result := IsAdmin;
end;
///<remarks>
Expand Down Expand Up @@ -673,8 +673,13 @@ begin
sUnInstPath := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\' + sAppId + '_is1';
Log('Looking in registry: ' + sUnInstPath);
sUnInstallString := '';
if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
if RegValueExists(HKLM, sUnInstPath, 'UninstallString') then
RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString)
else if RegValueExists(HKCU, sUnInstPath, 'UninstallString') then
RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString)
else
sUnInstallString := '';
Log('Result of registry query: ' + sUnInstallString);
Result := sUnInstallString;
end;
Expand Down Expand Up @@ -742,10 +747,15 @@ begin
sUnInstallString := GetUninstallString(AppId);
if sUnInstallString <> '' then begin
sUnInstallString := RemoveQuotes(sUnInstallString);
if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
Result := 3
if FileExists(sUnInstallString) then
begin
if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
Result := 3
else
Result := 2;
end
else
Result := 2;
Result := 1;
end else
Result := 1;
end;
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Expand Up @@ -58,7 +58,7 @@ environment:

before_build:
- development/java/Rubberduck.Parsing/Grammar/gradlew.bat -p development/java/Rubberduck.Parsing/Grammar clean build
- cinst innosetup -version 5.6.1
- cinst innosetup -version 6.0.5
- cinst codecov
- cinst opencover.portable
- nuget restore RubberduckMeta.sln
Expand Down

0 comments on commit 40cbfa4

Please sign in to comment.