Upgrading application and switching from 64-bit to

2019-07-26 17:47发布

问题:

I have a WiX installer that can be built as a 32 bit or a 64 bit installer, with some preprocessing to select between ProgramFilesFolder and ProgramFiles64Folder.

Since the installer places some files in the Shared Documents Folder and Common AppData, the two versions cannot co-exist side by side and so have the same Upgrade Code and different Product Codes.

RemoveExistingProducts is scheduled early, immediately after InstallValidate and I always perform a major upgrade between releases.

However, when an upgrade is performed from an earlier x64 version to a later x86 version, all the x64 files in c:\Program Files are left behind.

Reading the logs, it appears that when it comes to uninstall the older x64 components, it is looking in c:\Program Files (x86):

MSI (s) (50:08) [11:53:16:589]: Executing op: FileRemove(,FileName=common.dll,,ComponentId={1680271B-6AAD-4B2A-8F6E-BDCBC964CC92})
RemoveFiles: File: common.dll, Directory: C:\Program Files (x86)\XJTAG 3.5\Bin\

Originally, the components in both installers had the same GUIDs even though they are being installed into different locations in the two installers, knowing that scheduling RemoveExistingProducts early should allow me to get away with it. However, I built a new 32-bit installer with different GUIDs and the problem remains.

It doesn't happen the other way around. It seems that because the new version is a 32-bit installer it is using c:\Program Files (x86) rather than c:\Program Files.

Is this kind of upgrade just something that is impossible?