1
votes

I had an old installer which was a basic visual studio setup project and now it has been replaced by a WIX installer. The new Wix installer works fine, expect the necessity I have.

Many clients were installed with the old one and now, at next version of our product we need to use this Wix installer.

I need the Wix installer to replace the old installation without uninstalling the previous version through control panel.

I have tried putting the same Product Code as before, also changing the Upgrade Code and it doen't work.

Does anyone know whether is possible to replace installations from VS Installers with Wix Installers?

Wix

<?define Product.UpgradeCode = "{60DA573D-4C8A-48CA-ADA5-9C130A7100E8}" ?>
<?define Product.ProductCode = "{1A65C362-E880-4F2A-ADEF-B1D83A87C914}" ?>

<Product Id="$(var.Product.ProductCode)"
           Name="My Application"
           Language="1033"
           Version="$(var.REVISION)"
           Manufacturer="My Manufacturer"
           UpgradeCode="$(var.Product.UpgradeCode)">
           ...
           ...
<MajorUpgrade Schedule="afterInstallInitialize" 
  DowngradeErrorMessage="A later version of MY PRODUCT is already installed." />

<Upgrade Id="$(var.Product.UpgradeCode)">
<UpgradeVersion Minimum="$(var.BUILD)" 
    IncludeMinimum="no" OnlyDetect="yes" 
    Property="NEWERVERSIONDETECTED" />
  <UpgradeVersion Maximum="$(var.PREVBUILD)" 
   IncludeMaximum="yes" OnlyDetect="no" 
   Property="OLDERVERSIONBEINGUPGRADED" />
</Upgrade>

Error Message

Error

2
VS Installers and WIX installer both deliver an msi, there is no diference in that respect. The content of the msi might vary. $var.Revision is higher? And you have a MajorUpgrade element in your wix file: wixtoolset.org/documentation/manual/v3/howtos/updates/… - rene
@rene yes, $(var.REVISION) is higher than the old version. - Saxophonist
unfortunatelly not. Actually the Wix installer doesn't install if I have the old one installed.. (I have edited my code at description) - Saxophonist

2 Answers

4
votes

That error message means your ProductCode hasn't changed. You want the UpgradeCode to be the same but you want the ProductCode to be unique with each build. To achieve this you set it to "*" and the compiler will gen one at build time.

If you then install but get 2 entries in Add Remove Programs, that would mean you have a problem with your MajorUpgrade rule.

0
votes

In WiX v3.11.2, <MajorUpgrade> is OK for replacing setup of VS Setup Project.

In Product.wxs, this code worked.

<MajorUpgrade DowngradeErrorMessage="Downgrade Error" AllowSameVersionUpgrades="yes" />

And Same UpgradeCode is not enough for upgrading process.

How do I fix the upgrade logic of a wix setup after changing InstallScope to "perMachine"

For example, in my project, InstallScope = "perMachine" is bad , so I have removed this attribute.

<Package  InstallScope="perMachine"