Reputation: 241
The previous version of the application I am working on (along with its installer) was written by someone else. I have been having a hard time getting the update functionality to work, so I want to uninstall the previous version prior to the install, but after I can be sure that the install will go forward.
I am obviously doing something wrong. I want to execute the following command line from the installer, but before the installation begins. When I run the installer, the application installs, but my command line does not execute. Any help would be appreciated.
The command line I want to execute is:
start /wait MsiExec.exe /quiet /x{MyGuid-0F4A-4F53-8639-0BEE6018EAD6}
The pertinent part of my WiX XML:
<Property Id="QtExecCmdLine" Value="start /wait MsiExec.exe /x{MyGuid-0F4A-4F53-8639-0BEE6018EAD6}"/>
<CustomAction Id="UninstallOldVersion" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="ignore"/>
<InstallExecuteSequence>
<Custom Action="UninstallOldVersion" Before="InstallInitialize"/>
</InstallExecuteSequence>
The command works as expected if I execute it from a prompt. Also, I get no errors or warnings during the compile or execution of the installer.
Upvotes: 0
Views: 312
Reputation: 55600
What you are trying to do has no chance of working due to a mutex built-into Windows Installer that enforces one installation transaction at a time on a machine.
Instead you should look at the MajorUpgrade element to author the removal of the previous version.
Upvotes: 1