Inno Setup 根据window系统32位或64位安装对应程序

最近在弄java Swing 打包成可执行文件,这时候用到了Inno Setup工具,这个打包成安装程序还是非常不错的,下面用到的Inno Setup的脚本,有注释

; -- 64BitTwoArch.iss --
; Demonstrates how to install a program built for two different
; architectures (x86 and x64) using a single installer.

; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!

[Setup]
;安装时显示应用
AppName=PC_tool   
AppVersion=1.5
;安装目录
DefaultDirName=D:\install\PC_tool    
DefaultGroupName=PC_tool
;卸载文件名{app}为安装目录文件夹
UninstallDisplayIcon={app}\tool.exe
;压缩方式
Compression=lzma2
SolidCompression=yes
;生打包生成安装exe文件生成的位置
OutputDir=D:\JackWork\output
; "ArchitecturesInstallIn64BitMode=x64" requests that the install be
; done in "64-bit mode" on x64, 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
; Note: We don't set ProcessorsAllowed because we want this
; installation to run on all architectures (including Itanium,
; since it's capable of running 32-bit code too).

[Files]
; Install MyProg-x64.exe if running in 64-bit mode (x64; see above),
; Check: Is64BitInstallMode 表示是64位window系统
; Check: not Is64BitInstallMode表示是32位window系统
Source: "D:\JackWork\tool\tool64.exe"; DestDir: "{app}"; DestName: "tool64.exe"; Check: Is64BitInstallMode
Source: "D:\JackWork\tool\tool32.exe"; DestDir: "{app}"; DestName: "tool32.exe"; Check: not Is64BitInstallMode
;\*表示匹配tool文件的所有文件夹。 Flags: igNoreversion recursesubdirs createallsubdirs 表示所有子文件都包含在内
Source: "D:\JackWork\tool\*"; DestDir: "{app}"    ; Flags: igNoreversion recursesubdirs createallsubdirs


[Icons]
;生成对应系统快捷键{userdesktop} 表示桌面生成一个tool64.exe图标  Filename表示对应exe文件,WorkingDir工作目录
Name:"{userdesktop}\tool64.exe"; Filename:"{app}\tool64.exe"; WorkingDir:"{app}"; Check: Is64BitInstallMode
;生成对应系统快捷键{userdesktop} 表示桌面生成一个tool32.exe图标  Filename表示对应exe文件,WorkingDir工作目录
Name:"{userdesktop}\tool32.exe"; Filename:"{app}\tool32.exe"; WorkingDir:"{app}"; Check: not Is64BitInstallMode

仅作为参考:

参考地址:https://stackoverflow.com/questions/4833831/inno-setup-32bit-and-64bit-in-one

你可能感兴趣的:(java打包exe)