2 instances of the program after updating using WiX

I am creating an updatable installer using WiX, which should completely remove the existing program before installing the new version. I have update files and add a new version, but I still have 2 instances of the program on the "Add or Remove Programs" screen. Below is an example of how I am trying to delete everything.

<Product Id="064e9bca-dcf5-412d-9a8f-dafec3bd3406" Name="testInstall" Language="1033" Version="1.0.14" Manufacturer="testInstall" UpgradeCode="5dd5747f-c598-4133-8c7d-252ae3dee8a5">

<Package InstallerVersion="301" InstallPrivileges="elevated" InstallScope="perMachine" Compressed="yes" />

<Upgrade Id="5dd5747f-c598-4133-8c7d-252ae3dee8a5">
  <UpgradeVersion Minimum="1.0.0"
                  IncludeMinimum="yes"
                  Maximum="1.0.13"
                  OnlyDetect="no"
                  Property="OLDERVERSIONBEINGUPGRADED" />
</Upgrade>

<InstallExecuteSequence>
  <RemoveExistingProducts After="InstallInitialize"/>
</InstallExecuteSequence>

Any help that can be provided will be appreciated.

+3
source share
1 answer

Every time you want to create a new updated package, change ProductVersion and ProductGUI:

<?define ProductVersion="1.0.76"?>
<?define ProductGUI="945C22A0-BB37-4F7D-9B28-2F02491A0698"?>

<Upgrade Id="b14563a6-db4f-451c-8b9d-03e480687290">
    <UpgradeVersion OnlyDetect='yes' Property='NEWERVERSIONDETECTED' Minimum='$(var.ProductVersion)' IncludeMinimum='no' />
    <UpgradeVersion Minimum="1.0.0" IncludeMinimum="yes" Maximum="$(var.ProductVersion)" Property="OLDERVERSIONBEINGUPGRADED" />
</Upgrade>

...

<InstallExecuteSequence>
   <RemoveExistingProducts After="InstallValidate" />
   ...
</InstallExecuteSequence>

NOTE. Of course, use your own GUID for the update / identifier.

+5
source

Source: https://habr.com/ru/post/1722705/


All Articles