Release v1.0.22.3

Rating: No reviews yet
Downloads: 290
Change Set: 4f9e8981febb
Released: Jul 25, 2015
Updated: Jul 30, 2015 by oleg_s
Dev status: Stable Help Icon

Recommended Download

Application WixSharp.1.0.22.3.7z
application, 23607K, uploaded Jul 30, 2015 - 290 downloads

Release Notes

This is a major release, which delivers two principal components of the Managed Setup model
  • Event-driven API for implementing runtime behavior
  • FULLY customizable managed UI that matches the set of MSI standard dialogs
It also delivers support for MajorUpgrade element and assorted issues fixes.
The corresponding Wiki documentation is yet to be written but the code samples are already included into the distributables (<distro>/Wix# Samples/Managed Setup).

NuGet 'WixSharp' package is cleaned from the sample code and now it is equivalent of 'WixSharp.bin' package. It is a preparation for the imminent merge of these packages and separation of the packages with the samples into a separate package group.
Setup events:
static public void Main()
{
    var project =
        new ManagedProject("ManagedSetup",
            new Dir(@"%ProgramFiles%\My Company\My Product",
                new File(@"..\Files\bin\MyApp.exe"),
                new Dir("Docs",
                    new File("readme.txt"))));

    project.ManagedUI = ManagedUI.Empty;

    project.Load += msi_Load;
    project.BeforeInstall += msi_BeforeInstall;
    project.AfterInstall += msi_AfterInstall;

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

    Compiler.BuildMsi(project);
}

static void msi_Load(SetupEventArgs e)
{
    MessageBox.Show(e.ToString(), "Load");
}

static void msi_BeforeInstall(SetupEventArgs e)
{
    MessageBox.Show(e.ToString(), "BeforeInstall");
}

static void msi_AfterInstall(SetupEventArgs e)
{
    MessageBox.Show(e.ToString(), "AfterExecute");
}

Standard dialogs sequence:
var project = new ManagedProject("ManagedSetup",
                    new Dir(@"%ProgramFiles%\My Company\My Product",
                        new File(@"..\Files\bin\MyApp.exe"),
                        new Dir("Docs",
                            new File("readme.txt"),
                            new File("setup.cs")))); 

project.ManagedUI = new ManagedUI();

project.ManagedUI.InstallDialogs.Add(Dialogs.Welcome)
                                .Add(Dialogs.Licence)
                                .Add(Dialogs.SetupType)
                                .Add(Dialogs.Features)
                                .Add(Dialogs.InstallDir)
                                .Add(Dialogs.Progress)
                                .Add(Dialogs.Exit);

project.ManagedUI.ModifyDialogs.Add(Dialogs.MaintenanceType)
                               .Add(Dialogs.Features)
                               .Add(Dialogs.Progress)
                               .Add(Dialogs.Exit);

Custom dialogs sequence:
static public void Main()
{
    var project = new ManagedProject("ManagedSetup",
                        new User
                        {
                            Name = Defaults.UserName,
                            Password = "[PASSWORD]",
                            Domain = "[DOMAIN]",
                            PasswordNeverExpires = true,
                            CreateUser = true
                        },
                        new Property("PASSWORD", "pwd123"));

    project.SourceBaseDir = @"..\..\";
    project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b");
    project.LocalizationFile = "MyProduct.en-us.wxl";

    project.ManagedUI = new ManagedUI();
    project.ManagedUI.InstallDialogs.Add<Wix_Forms.WelcomeDialog>()
                                    .Add<MyProduct.UserNameDialog>()
                                    .Add<Wix_Forms.ProgressDialog>()
                                    .Add<Wix_Forms.ExitDialog>();

    project.ManagedUI.ModifyDialogs.Add<Wix_Forms.ProgressDialog>()
                                   .Add<Wix_Forms.ExitDialog>();

    project.BeforeInstall += msi_BeforeInstall;

    project.BuildMsi();
}

static void msi_BeforeInstall(SetupEventArgs e)
{
    if (e.Session["DOMAIN"] == null)
        e.Session["DOMAIN"] = Environment.MachineName;
}

Custom dialogs:
public partial class CustomDialog : ManagedForm, IManagedDialog
{
    public UserNameDialog()
    {
        //instantiate banner PictureBox and back/next/cancel Buttons
        InitializeComponent();
    }
    
    void CustomDialog_Load(object sender, EventArgs e)
    {
        banner.Image = MsiRuntime.Session.GetEmbeddedBitmap("WixUI_Bmp_Banner");
    } 
    
    void back_Click(object sender, EventArgs e)
    {
        Shell.GoPrev();
    }
    
    void next_Click(object sender, EventArgs e)
    {
        Shell.GoNext();
    }
    
    void cancel_Click(object sender, EventArgs e)
    {
        Shell.Cancel();
    }
}

Support for MajorUpgrade element:

project.MajorUpgrade = new MajorUpgrade
{
    Schedule = UpgradeSchedule.afterInstallInitialize,
    DowngradeErrorMessage = "A later version of [ProductName] is already "+
                            "installed. Setup will now exit."
};

Assorted Fixes:
  • #50: ServiceControl element order triggers Restart Manager
  • #53: User Log on as service
  • #54: Creating User failure

Reviews for this release

No reviews yet for this release.