1

I am searching the web but can't find any good documentation regarding this:
what definitions should be part of the 'cs' file and what should be part of the 'wxs' file ?

I am editing an existing (and working) installer project, which is implemented only in the 'cs' file.
I am trying to implement a Major Upgrade so as to first remove any older version installed.
But since i haven't found any option to do this via the 'cs' file, i understood i first need to implement the installer in the 'wxs' file. In that case, what will be with the 'cs' file? Should i put the code there in a comment ?

Anders Forsgren
  • 10,827
  • 4
  • 40
  • 77
Nisim Naim
  • 151
  • 1
  • 15

1 Answers1

1

Since you are using WixSharp and not Wix directly, you should edit CS file.

https://wixsharp.codeplex.com/

You can refer to it's manual. According to it, to implement major upgrade, you should add something like this:

    project.MajorUpgradeStrategy = MajorUpgradeStrategy.Default;
    project.MajorUpgradeStrategy.RemoveExistingProductAfter = Step.InstallInitialize;
Nikolay
  • 10,752
  • 2
  • 23
  • 51
  • (yeah.. i know that a .cs file is C#) I do have a "using WixSharp" in the .cs file. After building the project, an .exe file is created - running it will create a .msi file. – Nisim Naim Sep 01 '15 at 09:00
  • Ah, you are using WixSharp! That's a third-party tool to build WIX installer, not WIX itself. I.e. you create your installer in C#, then it's "compiled" by the tool to WXS and then one more time from WIX to MSI – Nikolay Sep 01 '15 at 10:20
  • Edited the answer - check the WixSharp Samples, there already exists one named "MajorUpgrade" – Nikolay Sep 01 '15 at 11:28
  • I see now. Thank you very much, @Nikolay – Nisim Naim Sep 01 '15 at 13:30