注意事项
Inno Setup6.0及以上版本生成的可执行文件,可以运行在Windows7及以上系统,不支持WindowsXP系统。
如果要运行在WindowsXP系统上,需要下载Inno Setup6.0之前的版本。
Inno Setup 汉化版5.3.4下载链接: https://download.csdn.net/download/Guarder_7/89625304
Inno Setup 官网链接:https://jrsoftware.org/isdl.php
正文开始
打开生成的iss文件
在[Setup]下输入:ArchitecturesInstallIn64BitMode=x64
在[File]中输入:
Source: “D:\DemoTest\XP\GNDView_WGS\GNDView_WGS\bin\x86x64\x64*”; DestDir: “{app}”; Check: Is64BitInstallMode
Source: “D:\DemoTest\XP\GNDView_WGS\GNDView_WGS\bin\x86x64\x86*”; DestDir: “{app}”; Check: not Is64BitInstallMode
修改成自己的路径就可以了
重点:在打包程序的时候x86的exe所在文件夹和x64的exe所在文件夹都要添加进来。
主执行文件随便选32位或者64位的exe都可以。
; 脚本由 Inno Setup 脚本向导 生成!
; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档!
#define MyAppName "Test"
#define MyAppVerName "1.0.2.0"
#define MyAppPublisher "我的公司"
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "Test.exe"
[Setup]
; 注: AppId的值为单独标识该应用程序。
; 不要为其他安装程序使用相同的AppId值。
; (生成新的GUID,点击 工具|在IDE中生成GUID。)
AppId={{FA4101C8-3A72-41A0-8980-08D54BEB521E}
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\Test v1.0.2.0
DefaultGroupName={#MyAppName}
OutputBaseFilename=Wireless Gap Sensor
SetupIconFile=E:\Icon\Test.ico
Compression=lzma
SolidCompression=yes
ArchitecturesInstallIn64BitMode=x64
[Languages]
Name: "chinesesimp"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "D:\DemoTest\XP\Test\bin\x86x64\x86\Test.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\DemoTest\XP\Test\bin\x86x64\x64\*"; DestDir: "{app}"; Check: Is64BitInstallMode
Source: "D:\DemoTest\XP\Test\bin\x86x64\x86\*"; DestDir: "{app}"; Check: not Is64BitInstallMode
; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#MyAppName}}"; Flags: nowait postinstall skipifsilent
Filename: "{app}\Microsoft Windows Runtime\dotNetFx40_Full_x86_x64.exe"; Parameters: ""; WorkingDir: "{tmp}"; StatusMsg: "Installing dependencies..."; Flags: waituntilterminated
我在Run后面添加了依赖项的安装,在安装Test程序之前,会先安装dotNetFx40_Full_x86_x64.exe。