1

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

Saxophonist
  • 677
  • 9
  • 16
  • 1
    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: http://wixtoolset.org/documentation/manual/v3/howtos/updates/major_upgrade.html – rene Aug 30 '13 at 19:06
  • @rene yes, $(var.REVISION) is higher than the old version. – Saxophonist Aug 30 '13 at 19:22
  • 1
    http://stackoverflow.com/questions/11119838/wix-installer-cant-upgrade-from-previously-installed-windows-installer-sw?rq=1 is this maybe true? – rene Aug 30 '13 at 19:36
  • unfortunatelly not. Actually the Wix installer doesn't install if I have the old one installed.. (I have edited my code at description) – Saxophonist Aug 30 '13 at 19:41

2 Answers2

4

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.

Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • Just made exactly as you suggested and did got 2 entries in ARP. :( – Saxophonist Aug 30 '13 at 19:48
  • Shouldn't I keep the same ProductCode as my Old VS Installer and change only the Updagrade code? – Saxophonist Aug 30 '13 at 19:48
  • 2
    While I understand that sounds logical, the opposite is true. The UpgradeCode stays the same and the ProductCode changes. The reason is the UpgradeCode really represents a family of products and the ProductCode represents a unique product. – Christopher Painter Aug 30 '13 at 20:26
  • 1
    Two entries in ARP means your MajorUpgrade is failing. Possible causes are the old install was Per-User and the new is Per-Machine (not allowed in Major Upgrade ) UpgradeCode changed, Upgrade table authored incorrectly (version ranges as an example ) – Christopher Painter Aug 30 '13 at 20:27
  • 1
    http://stackoverflow.com/questions/5669983/wix-old-versions-dont-disappear-in-add-remove-programs-list – Christopher Painter Aug 30 '13 at 20:28
  • 1
    Read the linked blog in the above question. You shouldn't be doing a MajorUpgrade and Upgrade entries. Also realize that ProductVersion is A.B.C not A.B.C.D. Changes in the 4th field are not seen as "newer" by Windows Installer. – Christopher Painter Aug 30 '13 at 20:31
  • I finally could make it work as expected. Couldn't succeed with but using the same tags informed above and adding it worked. Can't understand why dont work!! Anyway, Thank you for your help!!! – Saxophonist Sep 04 '13 at 16:22
0

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"
hiro.t
  • 41
  • 1
  • 8