How can I insert Run
(unzip.exe
and a batch file) within the Code
section instead of Run
? I attempted the approach used here Inno Setup: Install other installer and run it before continuing my install but unable to get it to work so I reverted to using the Run
section to run two scripts. What I have done so far appears sloppy. The Inno Setup "finished" page displays an option checkbox to run the batch script, whereas I'd prefer it to run automatically before reaching this stage.
[Setup]
PrivilegesRequired=admin
[Files]
Source: "CC.exe"; DestDir: "{pf}\CC"; DestName: "CC.exe"
Source: "bbb.update.zip"; DestDir: "{userdesktop}"; Flags: deleteafterinstall
Source: "unzip.exe"; DestDir: "{userdesktop}"; Flags: deleteafterinstall
[Run]
Filename: "{userdesktop}\unzip.exe"; \
Parameters: "x {userdesktop}\bbb.update.zip -d {userdesktop}"; \
Flags: runascurrentuser nowait
Filename: "{userdesktop}\update.bat"; \
Flags: runascurrentuser nowait postinstall skipifsilent
(the update.bat
file cleans up after installing)