Inno Setup 系列之安装、卸载时调用bat
需求
想在安装的时候调用install.bat,在卸载的时候调用uninstall.bat
解决
可以这样写 Inno Setup 的脚本:
[Setup]
; NOTE: The value of AppId uniquely identifies this application. ; Do not use the same AppId value in installers for other applications. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) AppId={{3FC1FD05-BEC7-430A-B7DB-F07155FDE93E} AppName={#MyAppName} AppVersion={#MyAppVersion}
[Types]
Name: "custom"; Description: "Custom installation"; Flags: iscustom
[Components]
Name: "XXXXXXX"; Description: "XXXXXXX"; Types: custom; Flags: fixed
[Files]
Source: "XXXXXXX.exe"; DestDir: "{app}"; Components: XXXXXXX
Source: "XXXXXXX.pdf"; DestDir: "{app}"; Components: XXXXXXX
Source: "XXXXXXX.ico"; DestDir: "{app}"; Components: XXXXXXX
Source: "install.bat"; DestDir: "{app}"; Components: SearchInOneStep
[Run]
Filename: "{app}\install.bat"; Description: "Install.bat"; Flags: nowait skipifdoesntexist
[UninstallRun]
Filename: "{pf}\XXXXXXX\uninstall.bat"; Flags: skipifdoesntexist
Inno Setup 中文帮助文档
https://download.csdn.net/download/qq_36190858/10836946