I made a Wix project
that attemps to install a simple .txt example file. But, as a prerequisite, I want to uninstall a previous application.
To do so, I know msiexec
allows you to uninstall a product by simply writing:
msiexec /x {PRODUCT_CODE}
on a command line.
Fortunately, I know this PRODUCT_CODE
, so I tried to create a CustomAction
to uninstall that product before the installation starts, like this:
<CustomAction Id="PropertyAssign" Property="SilentLaunch" Value="msiexec.exe /x {EA29682C-7DA1-441C-BF3E-702491F59258}" Execute="immediate" />
<CustomAction Id="SilentLaunch" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check" Impersonate="no" />
<InstallUISequence>
<Custom Action="PropertyAssign" After="CostFinalize" />
<Custom Action="SilentLaunch" After="PropertyAssign" />
</InstallUISequence>
But when I run the .msi
, it says there was an unexpected error with code 2762 and exits installation.
I know the mistake is in that line, as if I erase it, everything goes ok.
Any idea on how to run that command line without any mistakes?