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

  • 5
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值