Selaa lähdekoodia

Previously, 32-bit Setup could set utDeleteFile_DisableFsRedir. Now this has been renamed to utDeleteFile_Is64Bit and 32-bit Setup never sets it anymore. This means regserver entries need a way to signal to the uninstaller that the file is 64-bit despite the path being 32-bit. Or vice versa: in 64-bit Setup, if the file is 32-bit despite the path being 64-bit.

Add utDeleteFile_RegisteredWithOppositeBitness for this.
Martijn Laan 3 viikkoa sitten
vanhempi
sitoutus
70602f0649

+ 2 - 2
Projects/Res/Setup.version.rc

@@ -7,7 +7,7 @@
 // Explorer's Version tab (on Windows 2000) if \0's aren't included.
 
 1 VERSIONINFO
- FILEVERSION 51,1054,0
+ FILEVERSION 51,1055,0
  PRODUCTVERSION 0,0,0,0
  FILEFLAGSMASK 0x3fL
  FILEFLAGS 0x0L
@@ -20,7 +20,7 @@ BEGIN
         BLOCK "000004b0"
         BEGIN
             VALUE "FileDescription", "Setup/Uninstall\0"
-            VALUE "FileVersion", "51.1054.0.0\0"
+            VALUE "FileVersion", "51.1055.0.0\0"
                   // NOTE: Be sure to keep FILEVERSION in sync!
             VALUE "Comments", "This installation was built with Inno Setup.\0"
             VALUE "CompanyName", "                                                            \0"

BIN
Projects/Res/Setup.version.res


+ 4 - 1
Projects/Src/Setup.Install.pas

@@ -703,8 +703,11 @@ Retry:
       DeleteFlags := 0;
       if IsCurrentProcess64Bit then { Post-ApplyPathRedirRules we should check IsCurrentProcess64Bit and not Is64Bit }
         DeleteFlags := DeleteFlags or utDeleteFile_Is64Bit;
-      if foRegisterServer in CurFile^.Options then
+      if foRegisterServer in CurFile^.Options then begin
         DeleteFlags := DeleteFlags or utDeleteFile_RegisteredServer;
+        if IsCurrentProcess64Bit <> Is64Bit then
+          DeleteFlags := DeleteFlags or utDeleteFile_RegisteredWithOppositeBitness;
+      end;
       if foRegisterTypeLib in CurFile^.Options then
         DeleteFlags := DeleteFlags or utDeleteFile_RegisteredTypeLib;
       if foUninsRestartDelete in CurFile^.Options then

+ 5 - 2
Projects/Src/Setup.UninstallLog.pas

@@ -15,7 +15,7 @@ uses
   Windows, SysUtils, Shared.FileClass, Shared.CommonFunc;
 
 const
-  HighestSupportedHeaderVersion = 1054;
+  HighestSupportedHeaderVersion = 1055;
   { Each time the format of the uninstall log changes, HighestSupportedHeaderVersion
     must be incremented, even if the change seems backward compatible (such as
     adding a new flag, or using one of the Reserved slots). When this happens, the
@@ -92,6 +92,7 @@ const
   utDeleteFile_Is64Bit = 2048;
   utDeleteFile_GacInstalled = 4096;
   utDeleteFile_PerUserFont = 8192;
+  utDeleteFile_RegisteredWithOppositeBitness = 16384;
   utDeleteDirOrFiles_Extra = 1;
   utDeleteDirOrFiles_IsDir = 2;
   utDeleteDirOrFiles_DeleteFiles = 4;
@@ -931,7 +932,9 @@ begin
               { Unregister if necessary }
               if not IsTempFile then begin
                 if CurRec^.ExtraData and utDeleteFile_RegisteredServer <> 0 then begin
-                  LoggedUnregisterServer(CurRec^.ExtraData and utDeleteFile_Is64Bit <> 0,
+                  LoggedUnregisterServer(
+                    (CurRec^.ExtraData and utDeleteFile_Is64Bit <> 0) xor
+                    (CurRec^.ExtraData and utDeleteFile_RegisteredWithOppositeBitness <> 0),
                     CurRecData[0]);
                 end;
                 if CurRec^.ExtraData and utDeleteFile_RegisteredTypeLib <> 0 then begin