Inno Setup Exec doesn't wait for InstallShield

2020-03-05 06:51发布

Trying to uninstall a software using the uninstall string (and running that with Exec in InitializeSetup) before installation, it doesn't wait for the un-installation to complete but proceeds to the next step of installation in Inno Setup.

I am using the following code and the software I am trying to un-install in an Installshield product:

Exec(
  ExpandConstant('{pf}\InstallShield Installation Information\{{XXX8X88X-XX8X-88X8-X8XX-88X888X88888}\setup.exe'),
  '-s -runfromtemp -l0x0004 -removeonly -remove', '',
  SW_SHOW, ewWaitUntilTerminated, ReturnCode)

1条回答
该账号已被封号
2楼-- · 2020-03-05 07:07

The setup.exe most probably executes a subprocess for an actual uninstallation and exits itself. So Inno Setup seemingly does not wait for the process to finish. This is a common behavior, as the uninstaller needs to delete itself, what it cannot do, if it still running. So it creates a copy of itself (or another executable) in a temporary folder and (re)executes from there.

As per InstallShield documentation, you can try adding /w or /clone_wait switches to the command-line:

/w ... For a Basic MSI project, the /w option forces Setup.exe to wait until the installation is complete before exiting.

/clone_wait ... This parameter indicates that the original setup should wait for the cloned setup process to complete before exiting.

查看更多
登录 后发表回答