0

I'm very new to WiX and am creating an installer to update versions (previously we would manually uninstall the application and then install it). I did a test where I installed an older version of a dll to see what would happen, when I update the application that has this downgraded dll it would remove it completely.

I'm guessing this has to do with when I schedule RemoveExistingProducts. I currently have it scheduled for after InstallInitialize which is what most people seem to suggest, it had been working well until I found this problem. Previously I had tried scheduling it after InstallFinalize and it would only install the updated dlls and remove the unchanged dlls.

Here's some of the code that may be applicable to this issue:

<Upgrade Id="$(var.UpgradeCode)">
    <UpgradeVersion Minimum="$(var.BuildVersion)" IncludeMinimum="no" OnlyDetect="yes" 
    Language="1033" Property="NEWPRODUCTFOUND" />
    <UpgradeVersion Minimum="$(var.RTMOrigProductVersion)" IncludeMinimum="yes"
            Maximum="$(var.BuildVersion)" IncludeMaximum="yes" Language="1033" 
            Property="PREVIOUSVERSIONSINSTALLED" />
</Upgrade>
      
<MajorUpgrade AllowDowngrades="no" Schedule="afterInstallValidate" DowngradeErrorMessage="To install an older version of ___, please uninstall using Add Remove Programs in the Control Panel." />
    
<InstallExecuteSequence>
    <Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
    <RemoveExistingProducts After="InstallInitialize" />
</InstallExecuteSequence>

<InstallUISequence>
   <Custom Action ="PreventDowngrading" After="FindRelatedProducts">NEWPRODUCTFOUND</Custom>
</InstallUISequence>
    
<CustomAction Id="PreventDowngrading" Error="Newer version already installed." />
Sher
  • 1
  • 1

0 Answers0