WixSharp Version

Mar 3 at 6:29 AM
Hi,

I am trying to work out how I can set the version number in code and am not clear how to do it.
I want to generate two MSIs so the second one can upgrade the first one.

So in the sample code I want to generate two MSIs. MSI1 and MSI2. MSI2 will then upgrade MS1.

How can I change the code to make it work?

Thanks,

Ward
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using WixSharp;

/* ------------------------------ WIX Packages -------------------------------------- 

Get-Package

Id                                  Versions                                 ProjectName                                                                                                                            
--                                  --------                                 -----------                                                                                                                            
WiX                                 {3.10.3}                                 WixTest2
WixSharp.bin                        {1.4.0.0}                                WixTest2

Install-Package WiX
Install-Package WixSharp.bin

 ---------------------------------------------------------------------------------------- */

namespace WixTest2
{
    class Program
    {
        static void Main(string[] args)
        {
            string compiler_path = System.IO.Directory.GetParent(@"../../.").FullName + @"\Packages";

            compiler_path += @"\WiX.3.10.3\tools";

            Compiler.WixLocation = compiler_path;

            Guid Msi_Guid = new Guid("6f330b47-2577-43ad-9095-1861ba25889b");

            WixSharp.Project project1 = new Project("MSI1")
            {
                Name = "Test",
                Description = "MSI Test",
                GUID = Msi_Guid                
            };

            project1.ControlPanelInfo.Manufacturer = "ACME";
            Compiler.BuildMsi(project1);

            WixSharp.Project project2 = new Project("MSI2")
            {
                Name = "Test",
                Description = "MSI Test",
                GUID = Msi_Guid
            };

            project2.ControlPanelInfo.Manufacturer = "ACME";
            Compiler.BuildMsi(project2);
        }
    }
}
Coordinator
Mar 3 at 10:35 AM
Hi Wards,

You need to have a look at MajorUpgrade sample from the downloadables.

Please note that the project has been migrated to https://github.com/oleg-shilo/wixsharp.

Cheers