[gimp] Revert "build: fix removal of old GIMP versions during installation on Windows"



commit 68f4c8a5ed604f99652a55e0a34302c81ab0ac73
Author: Jernej Simončič <jernej|s-cccp eternallybored org>
Date:   Wed May 2 01:17:59 2018 +0200

    Revert "build: fix removal of old GIMP versions during installation on Windows"
    
    This reverts commit d8ae5481ac517284a050a24c00041920436a63cc.
    
    The original code was meant to remove old (pre-2.8) installers, which used WinGimp AppId.

 build/windows/installer/gimp3264.iss |   28 ++++++++++++++++------------
 1 files changed, 16 insertions(+), 12 deletions(-)
---
diff --git a/build/windows/installer/gimp3264.iss b/build/windows/installer/gimp3264.iss
index a0b6a98..799038e 100644
--- a/build/windows/installer/gimp3264.iss
+++ b/build/windows/installer/gimp3264.iss
@@ -92,10 +92,8 @@
 AppName=GIMP
 #if Defined(DEVEL) && DEVEL != ""
 AppID=GIMP-{#MAJOR}.{#MINOR}
-#define APP_ID="GIMP-" + MAJOR + "." + MINOR
 #else
 AppID=GIMP-{#MAJOR}
-#define APP_ID="GIMP-" + MAJOR
 #endif
 VersionInfoVersion={#VERSION}
 #if !defined(REVISION)
@@ -1280,7 +1278,6 @@ end;
 function RemoveOldGIMPVersions(): TRemoveOldGIMPResult;
 var lblInfo1,lblInfo2: TNewStaticText;
        RootKey: Integer;
-       SubKeyName: String;
        OldPath, UninstallString, WhichStr: String;
 begin
        Result := rogContinue;
@@ -1315,24 +1312,26 @@ begin
        begin
                DebugMsg('RemoveOldGIMPVersions',ExpandConstant('{app}') + ' exists, checking if old GIMP 
version is in it');*)
 
-               (*if Is64BitInstallMode() then
+               if Is64BitInstallMode() then
                        RootKey := HKLM32
-               else*)
+               else
                        RootKey := HKLM;
 
-               SubKeyName := 
ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#APP_ID}_is1');
-
-               if RegValueExists(RootKey,SubKeyName,'Inno Setup: App Path') then
+               if 
RegValueExists(RootKey,'Software\Microsoft\Windows\CurrentVersion\Uninstall\WinGimp-2.0_is1',
+                                 'Inno Setup: App Path') then
                begin
-                       if RegQueryStringValue(RootKey,SubKeyName,'Inno Setup: App Path',OldPath) then
+                       if 
RegQueryStringValue(RootKey,'Software\Microsoft\Windows\CurrentVersion\Uninstall\WinGimp-2.0_is1',
+                                              'Inno Setup: App Path',OldPath) then
                        begin
                                (*if LowerCase(RemoveBackslashUnlessRoot(OldPath)) = 
LowerCase(RemoveBackslashUnlessRoot(ExpandConstant('{app}'))) then
                                begin //directory contains previous version of GIMP, run it's uninstaller*)
                                        DebugMsg('RemoveOldGIMPVersions','Found legacy GIMP install, 
removing');
 
-                                       if RegValueExists(RootKey,SubKeyName,'QuietUninstallString') then
+                                       if 
RegValueExists(RootKey,'Software\Microsoft\Windows\CurrentVersion\Uninstall\WinGimp-2.0_is1',
+                                                         'QuietUninstallString') then
                                                WhichStr := 'QuietUninstallString'
-                                       else if RegValueExists(RootKey,SubKeyName,'UninstallString') then
+                                       else if 
RegValueExists(RootKey,'Software\Microsoft\Windows\CurrentVersion\Uninstall\WinGimp-2.0_is1',
+                                                              'UninstallString') then
                                                WhichStr := 'UninstallString'
                                        else
                                        begin
@@ -1340,7 +1339,8 @@ begin
                                                exit;
                                        end;
 
-                                       if not 
RegQueryStringValue(RootKey,SubKeyName,WhichStr,UninstallString) then
+                                       if not 
RegQueryStringValue(RootKey,'Software\Microsoft\Windows\CurrentVersion\Uninstall\WinGimp-2.0_is1',
+                                                                  WhichStr,UninstallString) then
                                        begin
                                                Result := rogCantUninstall;
                                                exit;
@@ -1352,9 +1352,13 @@ begin
                                        UninstallString := UninstallString + ' /NORESTART';
 
                                        DoUninstall(UninstallString, OldPath, lblInfo2, Result);
+                                       
                                //end;
                        end;
+                       
+                       
                end;
+
        //end;
 
        lblInfo1.Free;


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