CPack/NSIS: Installer does not wait for uninstallation to finish
b795c967 changed the invocation of the uninstaller from ExecWait '"$0" /S _?=$3'
to ExecWait '$0 /S'
.
This had the unintended side-effect that the uninstaller seems to copy itself to a different location and execute this copy as a child process and then exit. Therefore ExecWait
does no longer wait for the uninstaller to finish but merely for the copying and starting of the child process.
As a result of this, the uninstaller and installer both run in parallel and this can lead to all sorts of problems leaving the installation directory in an undefined state.
Adding back the _?
parameter fixes this. With the parameter, the uninstaller is executed directly and ExecWait
then properly waits for it to finish.
See also the NSIS docs (emphasis mine):
_?= sets $INSTDIR. It also stops the uninstaller from copying itself to the temporary directory and running from there. It can be used along with ExecWait to wait for the uninstaller to finish. It must be the last parameter used in the command line and must not contain any quotes, even if the path contains spaces.
MR incoming.