Search code examples
c#wixwixsharp

Wix 3.9 installer - 'cs' file Vs. 'wxs' file


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 ?


Solution

  • 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;