[gimp/gimp-2-10] Installer: handle missing install directory of GIMP <2.8 better when there's still uninstall info in



commit 778faaddc81169188c6a56432131f78fe5ee2f65
Author: Jernej Simončič <jernej|s-gitstuff eternallybored org>
Date:   Sun Jan 6 21:35:50 2019 +0100

    Installer: handle missing install directory of GIMP <2.8 better when there's still uninstall info in 
Registry

 build/windows/installer/gimp3264.iss | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/build/windows/installer/gimp3264.iss b/build/windows/installer/gimp3264.iss
index 884397e99a..738b4f2e0e 100755
--- a/build/windows/installer/gimp3264.iss
+++ b/build/windows/installer/gimp3264.iss
@@ -1411,7 +1411,6 @@ var InResult: TRemoveOldGIMPResult;
        ResultCode, i: Integer;
 begin
        InResult := oResult;
-       InstallDir := '';
 
        DebugMsg('DoUninstall','Uninstall string: ' + UninstStr);
 
@@ -1419,14 +1418,23 @@ begin
        if LowerCase(RemoveBackslashUnlessRoot(InstallDir)) = 
LowerCase(RemoveBackslashUnlessRoot(ExpandConstant('{app}'))) then
                oResult := rogRestartRequired
        else
-               oResult := rogContinue;
+               oResult := InResult;
 
        pInfoLabel.Caption := InstallDir;
 
        if not Exec('>',UninstStr,'',SW_SHOW,ewWaitUntilTerminated,ResultCode) then
        begin
-               DebugMsg('DoUninstall','Exec failed: ' + IntToStr(ResultCode));
-               oResult := rogUninstallFailed;
+               DebugMsg('DoUninstall','Exec('+UninstStr+') failed: ' + IntToStr(ResultCode));
+
+               if not DirExists(InstallDir) then //old install directory doesn't exist, assume it was 
deleted, and Registry info is orphaned
+               begin
+                       DebugMsg('DoUninstall','Install directory doesn'#39't exist: ' + InstallDir + ', 
resuming install');
+                       oResult := InResult
+               end else
+               begin   
+                       oResult := rogUninstallFailed;
+               end;
+
                exit;
        end;
 
@@ -1436,13 +1444,13 @@ begin
        i := 0;
        while i < (UNINSTALL_MAX_WAIT_TIME / UNINSTALL_CHECK_TIME) do
        begin
-               DebugMsg('DoUninstall','Waiting for ' + ExpandConstant('{app}') + ' to disappear [' + 
IntToStr(i) + ']');
                if not DirExists(ExpandConstant('{app}')) then
                begin
                        DebugMsg('DoUninstall','Existing GIMP directory removed, restoring previous restart 
requirement');
                        oResult := InResult; //restore previous result
                        break;
                end;
+               DebugMsg('DoUninstall','Waiting for ' + ExpandConstant('{app}') + ' to disappear [' + 
IntToStr(i) + ']');
                Sleep(UNINSTALL_CHECK_TIME); //it may take a few seconds for the uninstaller to remove the 
directory after it's exited
                Inc(i);
        end;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]