Inno Setup 系列之安裝、卸載時調用bat

需求

想在安裝的時候調用install.bat,在卸載的時候調用uninstall.batapp

解決

能夠這樣寫 Inno Setup 的腳本:ide

[Setup]this

; 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]spa

Name: "custom"; Description: "Custom installation"; Flags: iscustom

[Components].net

Name: "XXXXXXX"; Description: "XXXXXXX"; Types: custom; Flags: fixed

[Files]code

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]blog

Filename: "{app}\install.bat"; Description: "Install.bat"; Flags: nowait skipifdoesntexist

[UninstallRun]ip

Filename: "{pf}\XXXXXXX\uninstall.bat"; Flags: skipifdoesntexist

 

Inno Setup 中文幫助文檔
https://download.csdn.net/download/qq_36190858/10836946文檔

相關文章
相關標籤/搜索