Martijn Laan 6 年之前
父节点
当前提交
71c37d1359
共有 4 个文件被更改,包括 56 次插入5 次删除
  1. 52 0
      Examples/64BitThreeArch.iss
  2. 2 0
      Examples/MyProg/Myprog.c
  3. 1 4
      Projects/Compile.pas
  4. 1 1
      Projects/Main.pas

+ 52 - 0
Examples/64BitThreeArch.iss

@@ -0,0 +1,52 @@
+; -- 64BitThreeArch.iss --
+; Demonstrates how to install a program built for three different
+; architectures (x86, x64, ARM64) using a single installer.
+
+; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!
+
+[Setup]
+AppName=My Program
+AppVersion=1.5
+DefaultDirName={autopf}\My Program
+DefaultGroupName=My Program
+UninstallDisplayIcon={app}\MyProg.exe
+Compression=lzma2
+SolidCompression=yes
+OutputDir=userdocs:Inno Setup Examples Output
+; "ArchitecturesInstallIn64BitMode=x64 arm64" requests that the install
+; be done in "64-bit mode" on x64 & ARM64, meaning it should use the
+; native 64-bit Program Files directory and the 64-bit view of the
+; registry. On all other architectures it will install in "32-bit mode".
+ArchitecturesInstallIn64BitMode=x64 arm64
+
+[Files]
+; Install MyProg-x64.exe if running on x64, MyProg-ARM64.exe if
+; running on ARM64, MyProg.exe otherwise.
+; Place all x64 files here
+Source: "MyProg-x64.exe"; DestDir: "{app}"; DestName: "MyProg.exe"; Check: InstallX64
+; Place all ARM64 files here, first one should be marked 'solidbreak'
+Source: "MyProg-ARM64.exe"; DestDir: "{app}"; DestName: "MyProg.exe"; Check: InstallARM64; Flags: solidbreak
+; Place all x86 files here, first one should be marked 'solidbreak'
+Source: "MyProg.exe"; DestDir: "{app}"; Check: InstallOtherArch; Flags: solidbreak
+; Place all common files here, first one should be marked 'solidbreak'
+Source: "MyProg.chm"; DestDir: "{app}"; Flags: solidbreak
+Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme
+
+[Icons]
+Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"
+
+[Code]
+function InstallX64: Boolean;
+begin
+  Result := Is64BitInstallMode and (ProcessorArchitecture = paX64);
+end;
+
+function InstallARM64: Boolean;
+begin
+  Result := Is64BitInstallMode and (ProcessorArchitecture = paARM64);
+end;
+
+function InstallOtherArch: Boolean;
+begin
+  Result := not InstallX64 and not InstallARM64;
+end;

+ 2 - 0
Examples/MyProg/Myprog.c

@@ -5,6 +5,8 @@
 	#define ARCHNOTE TEXT("")
 #elif defined(_AMD64_)
 	#define ARCHNOTE TEXT("\n\n(This EXE was compiled for the x64 architecture.)")
+#elif defined(_ARM64_)
+	#define ARCHNOTE TEXT("\n\n(This EXE was compiled for the ARM64 architecture.)")
 #elif defined(_IA64_)
 	#define ARCHNOTE TEXT("\n\n(This EXE was compiled for the Itanium architecture.)")
 #else

+ 1 - 4
Projects/Compile.pas

@@ -3696,10 +3696,7 @@ var
              Include(Result, paX86);
         1: Include(Result, paX64);
         2: Include(Result, paIA64);
-        3: if Only64Bit then
-             Invalid //ARM64 can actually only run x86 binaries
-           else
-             Include(Result, paARM64);
+        3: Include(Result, paARM64);
       end;
   end;
 

+ 1 - 1
Projects/Main.pas

@@ -4377,7 +4377,7 @@ begin
     5. GetSystemWow64DirectoryA is available.
     6. RegDeleteKeyExA is available.
     The system does not have to be one of the known 64-bit architectures
-    (AMD64, IA64) to be considered a "Win64" system. }
+    (AMD64, IA64, ARM64) to be considered a "Win64" system. }
 
   IsWin64 := False;
   KernelModule := GetModuleHandle(kernel32);