I would've expected that setting
RemovePreviousVersion = true
in the setup project would cause the previous version to be removed regardless of if the new version is installed into a different target folder. Is this assumption wrong per se? I did NOT change the UpgradeCode GUID.
However, the old version folder, as well as the entry in "Programs & Features" remains.
In my scenario the current target install folder is
"%ProgramFiles(x86)%\MySoftware v1"
Now I have a major version upgrade to v2 and want to reflect that in the install folder, changing it to
"%ProgramFiles(x86)%\MySoftware v2".
I would prefer if "MySoftware v1" is removed during the upgrade.
Before changing the target folder, it worked as expected. So I assume my setup project settings are correct in general.
What exactly are the criteria that must match between two setup projects, so that it detects that a previous version should be removed? My understanding was, that UpgradeCode is used to uniquely identify a project, but as I pointed out I did not change it.
It should completely remove the older version. This article has a lot of the detail:
https://www.red-gate.com/simple-talk/dotnet/visual-studio/updates-to-setup-projects/
but the main reasons for failure to remove are:
The UpgradeCode of your new setup is not the same as the old one, but you say they are the same so...
The first install was an Everyone (or Just me) and the upgrade is not the same context.