Inno Setup Exec doesn't wait for InstallShield uninstallation to complete

风流意气都作罢 提交于 2019-11-30 18:57:54

问题


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:


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.



来源:https://stackoverflow.com/questions/49893227/inno-setup-exec-doesnt-wait-for-installshield-uninstallation-to-complete

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!