Browse Source

Cleanup Itanium check.

Martijn Laan 1 năm trước cách đây
mục cha
commit
d42bf1bba8
2 tập tin đã thay đổi với 19 bổ sung22 xóa
  1. 17 20
      Projects/Src/Main.pas
  2. 2 2
      Projects/Src/Struct.pas

+ 17 - 20
Projects/Src/Main.pas

@@ -3251,11 +3251,17 @@ begin
         SetActiveLanguage(I);
         SetActiveLanguage(I);
     end;
     end;
   end;
   end;
+
+  { Check unsupported Itanium - must be on Windows Server 2008 R2 so remove once
+    this becomes unsupported as well and Windows 8 (6.2+) becomes the new minimum }
+  var SysInfo: TSystemInfo;
+  GetNativeSystemInfo(SysInfo);
+  if SysInfo.wProcessorArchitecture = PROCESSOR_ARCHITECTURE_IA64 then
+    AbortInit(msgWindowsVersionNotSupported);
   
   
-  { Check processor architecture }
-  if (ProcessorArchitecture = paIA64) or { Remove once Windows 8 (6.2+) becomes the new minimum }
-     ((SetupHeader.ArchitecturesAllowed <> '') and
-      not EvalExpression(SetupHeader.ArchitecturesAllowed, TDummyClass.EvalArchitectureIdentifier)) then
+  { Check allowed processor architectures }
+  if (SetupHeader.ArchitecturesAllowed <> '') and
+     not EvalExpression(SetupHeader.ArchitecturesAllowed, TDummyClass.EvalArchitectureIdentifier) then
     AbortInit(msgWindowsVersionNotSupported);
     AbortInit(msgWindowsVersionNotSupported);
 
 
   { Check Windows version }
   { Check Windows version }
@@ -4387,7 +4393,6 @@ const
   UserEnabled = $1;
   UserEnabled = $1;
 var
 var
   KernelModule: HMODULE;
   KernelModule: HMODULE;
-  GetNativeSystemInfoFunc: procedure(var lpSystemInfo: TSystemInfo); stdcall;
   IsWow64ProcessFunc: function(hProcess: THandle; var Wow64Process: BOOL): BOOL; stdcall;
   IsWow64ProcessFunc: function(hProcess: THandle; var Wow64Process: BOOL): BOOL; stdcall;
   IsWow64Process2Func: function(hProcess: THandle; var pProcessMachine, pNativeMachine: USHORT): BOOL; stdcall;
   IsWow64Process2Func: function(hProcess: THandle; var pProcessMachine, pNativeMachine: USHORT): BOOL; stdcall;
   GetMachineTypeAttributesFunc: function(Machine: USHORT; var MachineTypeAttributes: Integer): HRESULT; stdcall;
   GetMachineTypeAttributesFunc: function(Machine: USHORT; var MachineTypeAttributes: Integer): HRESULT; stdcall;
@@ -4402,8 +4407,7 @@ begin
     conditions are true:
     conditions are true:
     1. One of the following two is true:
     1. One of the following two is true:
        a. IsWow64Process2 is available, and returns True for the current process.
        a. IsWow64Process2 is available, and returns True for the current process.
-       b. GetNativeSystemInfo is available +
-          IsWow64Process is available, and returns True for the current process.
+       b. IsWow64Process is available, and returns True for the current process.
     2. Wow64DisableWow64FsRedirection is available.
     2. Wow64DisableWow64FsRedirection is available.
     3. Wow64RevertWow64FsRedirection is available.
     3. Wow64RevertWow64FsRedirection is available.
     4. GetSystemWow64DirectoryA is available.
     4. GetSystemWow64DirectoryA is available.
@@ -4420,27 +4424,21 @@ begin
     IsWin64 := True;
     IsWin64 := True;
     case NativeMachine of
     case NativeMachine of
       IMAGE_FILE_MACHINE_I386: ProcessorArchitecture := paX86;
       IMAGE_FILE_MACHINE_I386: ProcessorArchitecture := paX86;
-      IMAGE_FILE_MACHINE_IA64: ProcessorArchitecture := paIA64;
       IMAGE_FILE_MACHINE_AMD64: ProcessorArchitecture := paX64;
       IMAGE_FILE_MACHINE_AMD64: ProcessorArchitecture := paX64;
       IMAGE_FILE_MACHINE_ARM64: ProcessorArchitecture := paArm64;
       IMAGE_FILE_MACHINE_ARM64: ProcessorArchitecture := paArm64;
     else
     else
       ProcessorArchitecture := paUnknown;
       ProcessorArchitecture := paUnknown;
     end;
     end;
   end else begin
   end else begin
-    GetNativeSystemInfoFunc := GetProcAddress(KernelModule, 'GetNativeSystemInfo');
-    if Assigned(GetNativeSystemInfoFunc) then begin
-      GetNativeSystemInfoFunc(SysInfo);
-      IsWow64ProcessFunc := GetProcAddress(KernelModule, 'IsWow64Process');
-      if Assigned(IsWow64ProcessFunc) and
-         IsWow64ProcessFunc(GetCurrentProcess, Wow64Process) and
-         Wow64Process then
-        IsWin64 := True;
-    end else
-      GetSystemInfo(SysInfo);
+    IsWow64ProcessFunc := GetProcAddress(KernelModule, 'IsWow64Process');
+    if Assigned(IsWow64ProcessFunc) and
+       IsWow64ProcessFunc(GetCurrentProcess, Wow64Process) and
+       Wow64Process then
+      IsWin64 := True;
 
 
+    GetNativeSystemInfo(SysInfo);
     case SysInfo.wProcessorArchitecture of
     case SysInfo.wProcessorArchitecture of
       PROCESSOR_ARCHITECTURE_INTEL: ProcessorArchitecture := paX86;
       PROCESSOR_ARCHITECTURE_INTEL: ProcessorArchitecture := paX86;
-      PROCESSOR_ARCHITECTURE_IA64: ProcessorArchitecture := paIA64;
       PROCESSOR_ARCHITECTURE_AMD64: ProcessorArchitecture := paX64;
       PROCESSOR_ARCHITECTURE_AMD64: ProcessorArchitecture := paX64;
       PROCESSOR_ARCHITECTURE_ARM64: ProcessorArchitecture := paArm64;
       PROCESSOR_ARCHITECTURE_ARM64: ProcessorArchitecture := paArm64;
     else
     else
@@ -4459,7 +4457,6 @@ begin
     - x64: [paX86, paX64]
     - x64: [paX86, paX64]
       (but not paX86 in a future x64 build of Inno Setup if Windows was installed
       (but not paX86 in a future x64 build of Inno Setup if Windows was installed
        without support for x86 binaries (which is possible with Windows Server))
        without support for x86 binaries (which is possible with Windows Server))
-    - Itanium: [paX86, paIA64]
     - Arm64 Windows 10: [paX86, paArm64, paArm32]
     - Arm64 Windows 10: [paX86, paArm64, paArm32]
       (Arm32 support detected, not just assumed)
       (Arm32 support detected, not just assumed)
     - Arm64 Windows 11: [paX86, paX64, paArm64, paArm32]
     - Arm64 Windows 11: [paX86, paX64, paArm64, paArm32]

+ 2 - 2
Projects/Src/Struct.pas

@@ -69,7 +69,7 @@ type
   TSetupLanguageDetectionMethod = (ldUILanguage, ldLocale, ldNone);
   TSetupLanguageDetectionMethod = (ldUILanguage, ldLocale, ldNone);
   TSetupCompressMethod = (cmStored, cmZip, cmBzip, cmLZMA, cmLZMA2);
   TSetupCompressMethod = (cmStored, cmZip, cmBzip, cmLZMA, cmLZMA2);
   TSetupSalt = array[0..7] of Byte;
   TSetupSalt = array[0..7] of Byte;
-  TSetupProcessorArchitecture = (paUnknown, paX86, paX64, paIA64, paArm32, paArm64);
+  TSetupProcessorArchitecture = (paUnknown, paX86, paX64, paArm32, paArm64);
   TSetupProcessorArchitectures = set of TSetupProcessorArchitecture;
   TSetupProcessorArchitectures = set of TSetupProcessorArchitecture;
   TSetupDisablePage = (dpAuto, dpNo, dpYes);
   TSetupDisablePage = (dpAuto, dpNo, dpYes);
   TSetupPrivilegesRequired = (prNone, prPowerUser, prAdmin, prLowest);
   TSetupPrivilegesRequired = (prNone, prPowerUser, prAdmin, prLowest);
@@ -78,7 +78,7 @@ type
   TSetupWizardStyle = (wsClassic, wsModern);
   TSetupWizardStyle = (wsClassic, wsModern);
 const
 const
   SetupProcessorArchitectureNames: array[TSetupProcessorArchitecture] of String =
   SetupProcessorArchitectureNames: array[TSetupProcessorArchitecture] of String =
-    ('Unknown', 'x86', 'x64', 'Itanium', 'Arm32', 'Arm64');
+    ('Unknown', 'x86', 'x64', 'Arm32', 'Arm64');
 
 
 const
 const
   SetupHeaderStrings = 32;
   SetupHeaderStrings = 32;