Example #1
0
    static public void Main(string[] args)
    {
        if (Environment.GetEnvironmentVariable("APPVEYOR") != null)
        {
            return;
        }
        // Compiler.WixLocation = @"..\..\..\..\..\Wix_bin\bin";

        if (args.Contains("/test")) //for demo only
        {
            UIShell.Play(ManagedUI.Default.InstallDialogs);
            return;
        }

        //Note if the property 'PASSWORD' is not preserved as deferred then it will not be available
        //from the Project_AfterInstall, which is a deferred custom action.
        var project = new ManagedProject("ManagedSetup",
                                         new User
        {
            Name                 = Defaults.UserName,
            Password             = "******",
            Domain               = "[DOMAIN]",
            PasswordNeverExpires = true,
            CreateUser           = true
        },
                                         new Binary("CUSTOM_LNG".ToId(), "WixUI_fi-FI.wxl"),
                                         new Property("PASSWORD", "pwd123")
        {
            IsDeferred = true
        });

        project.SourceBaseDir = @"..\..\";
        project.GUID          = new Guid("6f330b47-2577-43ad-9095-1861ba25889b");
        //project.LocalizationFile = "MyProduct.en-us.wxl";
        project.LocalizationFile = "WixUI_de-de.wxl";
        project.Language         = "de-de";
        project.SetNetFxPrerequisite("NETFRAMEWORK35='#1'", "Please install .NET 3.5 first.");
        project.ManagedUI = new ManagedUI();
        project.ManagedUI.InstallDialogs.Add <WelcomeDialog>()
        .Add <MyProduct.UserNameDialog>()
        .Add <ProgressDialog>()
        .Add <ExitDialog>();

        //it effectively becomes a 'Repair' sequence
        project.ManagedUI.ModifyDialogs.Add <ProgressDialog>()
        .Add <ExitDialog>();

        project.UILoaded      += msi_UILoaded;
        project.BeforeInstall += msi_BeforeInstall;
        project.AfterInstall  += Project_AfterInstall;

        project.PreserveTempFiles = true;

        project.DefaultRefAssemblies.Add(@"C:\Users\oleg.shilo\source\repos\WindowsFormsApp2\WixSharp Setup1\bin\Debug\WpfControlLibrary2.dll");

        project.BuildMsi();
    }
Example #2
0
    static public void Main(string[] args)
    {
        if (args.Contains("/test")) //for demo only
        {
            UIShell.Play(ManagedUI.Default.InstallDialogs);
            return;
        }

        //Note if the property 'PASSWORD' is not preserved as deferred then it will not be available
        //from the Project_AfterInstall, which is a deferred custom action.

        var project = new ManagedProject("ManagedSetup",
                                         new User
        {
            Name                 = Defaults.UserName,
            Password             = "******",
            Domain               = "[DOMAIN]",
            PasswordNeverExpires = true,
            CreateUser           = true
        },
                                         new Property("PASSWORD", "pwd123")
        {
            IsDeferred = true
        });

        project.SourceBaseDir = @"..\..\";
        project.GUID          = new Guid("6f330b47-2577-43ad-9095-1861ba25889b");
        //project.LocalizationFile = "MyProduct.en-us.wxl";
        project.LocalizationFile = "WixUI_de-de.wxl";
        project.Language         = "de-de";
        project.SetNetFxPrerequisite("NETFRAMEWORK35='#1'", "Please install .NET 3.5 first.");
        project.ManagedUI = new ManagedUI();
        project.ManagedUI.InstallDialogs.Add <WelcomeDialog>()
        .Add <MyProduct.UserNameDialog>()
        .Add <ProgressDialog>()
        .Add <ExitDialog>();

        //it effectively becomes a 'Repair' sequence
        project.ManagedUI.ModifyDialogs.Add <ProgressDialog>()
        .Add <ExitDialog>();

        project.UIInitialized += e =>
        {
            Debug.Assert(false);
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(project.Language);
        };

        project.UILoaded      += msi_UILoaded;
        project.BeforeInstall += msi_BeforeInstall;
        project.AfterInstall  += Project_AfterInstall;

        project.PreserveTempFiles = true;

        project.BuildMsi();
    }
Example #3
0
 static void TestDialogs()
 {
     UIShell.Play(
         "WixSharp_UI_INSTALLDIR=INSTALLDIR", // required by InstallDirDialog for initialization of the demo MSI session
         typeof(Custom.WelcomeDialog),
         typeof(Custom.LicenceDialog),
         typeof(Custom.InstallDirDialog),
         typeof(Custom.MaintenanceTypeDialog),
         typeof(Custom.SetupTypeDialog),
         typeof(Custom.FeaturesDialog),
         typeof(Custom.ProgressDialog),
         typeof(Custom.ExitDialog));
 }