I have the installer generated by WiX and I want it-ask: "You have the already installed this app. Does want to uninstall it? "when run. Currently it installs the app once more and uninstalls it incorrectly if there is another version installed before.
The folowing would allow your to perform an upgrade, which removes previous versions:
<?define Version = "! (bind.fileversion.<your-file-here>) "?><?define UpgradeCode = "<YOUR-GUID-HERE>"?><UpgradeId= "$ (var.) UpgradeCode) "> <upgradeversionMinimum= "$ (var.) Version) "Includeminimum= "No"Onlydetect= "Yes" Property= "newerversiondetected" /> <upgradeversionMinimum= "0.0.0"Maximum= "$ (var.) Version) "Includeminimum= "Yes"Includemaximum= "Yes" Property= "olderversionbeingupgraded" /></Upgrade><InstallExecuteSequence> <removeexistingproducts After= "Installinitialize" /> <CustomAction= "Newerversion" After= "Findrelatedproducts">newerversiondetected</Custom></InstallExecuteSequence><CustomActionId= "Newerversion"Error= "A later version of [ProductName] is already installed." />
You'll need to define UpgradeCode and Version to suit your needs, this would also allow you to perfom an upgrade even if The version hasn ' t changed.
Wix:uninstall older version of the application