2
votes

I'm using Inno Setup, and I need to install a 3rd party software. But if I cancel the 3rd party installation, the setup will skip the postinstall run tasks and proceed to completing setup wizard which prompt for computer restart. Is there a way to proceed to postinstall even after canceling 3rd party installation? Here are the sample code.

[Tasks]
Name: "install_3rdparty"; Description: "Install 3rd party"; GroupDescription: "Prerequisite software:"

[Files]
Source: "driver\3rdparty.exe"; DestDir: {app}\driver

[Run]
Filename: "{app}\driver\3rdparty.exe"; StatusMsg: "Installing 3rd party"; Check: IsWin64(); Tasks: install_3rdparty; Flags: skipifsilent
Filename: "{app}\my_program.exe"; Flags: postinstall; Description: "Launch my program" 
1

1 Answers

2
votes

Inno Setup for some reason believes that the 3rd party installer made a change that requires restart.

Probably because the 3rd party installer scheduled a file replace for the next reboot.

You can disable Inno Setup from detecting this using RestartIfNeededByRun directive:

When set to yes, and a program executed in the [Run] section queues files to be replaced on the next reboot (by calling MoveFileEx or by modifying wininit.ini), Setup will detect this and prompt the user to restart the computer at the end of installation.