vc_redist.x64.exe 文件放在cod.exe 所在目录
[Files]
Source: “你要打包的软件目录\COD.exe”; DestDir: “{app}”; Flags: ignoreversion
Source: “你要打包的软件目录\vc_redist.x64.exe”; DestDir: “{app}”; Flags: ignoreversion
[Run]
Filename:“"{app\vc_redist.x64.exe”;Flags: nowait skipifsilent
#define MyAppName "我的程序"
#define MyAppVersion "1.5"
#define MyAppPublisher "我的公司"
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "COD.exe"
#define VCExeLibrary "vc_redist.x64.exe"
[Run]
;Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
Filename: "{app}\{#VCExeLibrary}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait skipifsilent
nowait
执行命令的时候,安装包进程不等待此命令执行完成
skipifsilent
如果当前是静默安装模式,那么跳过
postinstall
将会在安装完成界面创建一个可选按钮,让用户勾选或不勾选,当用户勾选时将会执行。默认选项是勾选
unchecked
配合 postinstall 将会修改默认值是不勾选,也就是点击完成不会执行命令
=实例================
; 脚本由 Inno Setup 脚本向导 生成!
; 有关创建 Inno Setup 脚本文件的详细资料请查阅帮助文档!
#define MyAppName "我的程序"
#define MyAppVersion "1.5"
#define MyAppPublisher "我的公司"
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "COD.exe"
#define VCExeLibrary "vc_redist.x64.exe"
[Setup]
; 注: AppId的值为单独标识该应用程序。
; 不要为其他安装程序使用相同的AppId值。
; (若要生成新的 GUID,可在菜单中点击 "工具|生成 GUID"。)
AppId={{13C889DA-082E-43E4-9FE8-E09388CEB690}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
; 以下行取消注释,以在非管理安装模式下运行(仅为当前用户安装)。
;PrivilegesRequired=lowest
OutputDir=E:\workstation\输出安装包\COD
OutputBaseFilename=mysetupCOD
Compression=lzma
SolidCompression=yes
WizardStyle=modern
[Languages]
Name: "chinesesimp"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "E:\workstation\输出绿色版\C0D\COD SUPEC 5000_v1.0.9 Release\COD.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\workstation\输出绿色版\C0D\COD SUPEC 5000_v1.0.9 Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; 注意: 不要在任何共享系统文件上使用“Flags: ignoreversion”
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
;Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
Filename: "{app}\{#VCExeLibrary}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait skipifsilent