I have installer generated by WiX and I want it to ask: "You have already installed this app. Do you want to uninstall it?" when run. Currently it installs the app once more and uninstalls it incorrectly if there was another version installed before.
The folowing will allow you to perform an upgrade, which removes previous versions:
You will need to define UpgradeCode and Version to suit your needs, this will also allow you to perfom an upgrade even if the version hasn't changed.