We use WiX for building installation packages. I am new to WiX technology and currently trying to do a major upgrade of the installed application, but on the different directory location than the previous version. For example, if v2 of a product was installed on Program Files (x86)\Old_path\Product , I would like to installed the upgraded version v3 on a different folder C:\Program Files (x86)\New_path\Product.
I have modified the msi property INSTALLDIR to have the new location path. We tried to alter the InstallExecuteSequence, added RemoveRegistryValues after InstallValidate to remove stored old path on registry and did WriteRegistryValues to add new registry values.
<InstallExecuteSequence>
....
<Custom Action="HxPrepare" Before="InstallValidate">NOT Installed</Custom>
<RemoveRegistryValues After="InstallValidate" />
<WriteRegistryValues />
<Custom Action="HxFinalize" Before="StartServices">NOT Installed</Custom>
....
<InstallExecuteSequence />
But I see no change in the installation process, and the new files get copied to the old directory path only. Can I know where is this old path obtained from even after modifying the INSTALLDIR path? How could we do this installation path change during major upgrades.
Reply to the comment by PhilDW :
That is a correct process for Major upgrade. All the older version files are removed. But however in our application, there is no browse dialogue during upgradation to ask for the new/required installation directory. It simply takes previous version path. This is because first we need to take a back up of important settings/user configured files of lower version and later use them in the upgraded version. After this backup is saved, I try to move this backup files to new path and later start copying new files. I do this path change to INSTALLDIR in HxPrepare step and want to continue the process in the new directory. But I cannot know from where the old path is only considered.
<InstallExecuteSequence>
<RemoveExistingProducts After="InstallInitialize" />
<Custom Action="PreventDowngrade" After="FindRelatedProducts">DOWNGRADE</Custom>
<Custom Action="HxInit" After="CostFinalize">NOT Installed</Custom>
<Custom Action="HxPrepare" Before="InstallValidate">NOT Installed</Custom>
<Custom Action="HxFinalize" Before="StartServices">NOT Installed</Custom>
<Custom Action="HxPreUninstall" Before="InstallValidate">(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")</Custom>
<Custom Action="HxUninstall" After="InstallInitialize">(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")</Custom>
The reason I want to perform this installation path change is because I want to change the product manufacturer name and I want the major upgrade of the product to happen on the new path like "C:\Program Files (x86)\New_manufacturer\Product installation" . How can I achieve this?