static public void Main(string[] args) { 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(@"..\Files\Docs\tutorial.txt")))); project.ManagedUI = ManagedUI.Default; project.ManagedUI.Icon = "app.ico"; project.MinimalCustomDrawing = true; project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b"); project.ControlPanelInfo.InstallLocation = "[INSTALLDIR]"; project.SetNetFxPrerequisite(Condition.Net45_Installed, "Please install .Net 4.5 First"); // project.PreserveTempFiles = true; project.SourceBaseDir = @"..\..\"; project.Localize(); project.BuildMsi(); }
static public void Main() { var project = new ManagedProject("ManagedSetup", new User { Name = Defaults.UserName, 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 <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.BuildMsi(); }
private static void Main() { var currentFolder = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) ?? Environment.CurrentDirectory; var root = Path.GetFullPath(Path.Combine(currentFolder, @"..\..\..\..\..\")); var appRoot = Path.Combine(root, $@"Matrix\Howatworks.Matrix.Wpf\bin\{Configuration}\{TargetNetFramework}\"); var project = new ManagedProject("SubEtha Matrix", new Dir(@"%ProgramFiles%\Howatworks\SubEtha Matrix", new Files(appRoot + "*") ), new Dir("%StartMenu%", new ExeFileShortcut("SubEtha Matrix", "[INSTALLDIR]Howatworks.Matrix.Wpf.exe", arguments: "") ) ) { Platform = Platform.x64, GUID = new Guid("6fe30b47-2577-43ad-9095-1861ba25889b"), ManagedUI = ManagedUI.Default, LicenceFile = "LICENSE.rtf", ControlPanelInfo = new ProductInfo() { ProductIcon = "thumb_red.ico", Manufacturer = "Howatworks" }, Version = Version.Parse(GitVersionInformation.AssemblySemFileVer), OutFileName = Path.Combine(root, @"..\.build\Installers", "Howatworks.Matrix") }; project.Load += Msi_Load; project.BeforeInstall += Msi_BeforeInstall; project.AfterInstall += Msi_AfterInstall; Compiler.AllowNonRtfLicense = true; project.BuildMsi(); }
static public void Main() { var binaries = new Feature("Binaries", "Product binaries", true, false); var docs = new Feature("Documentation", "Product documentation (manuals and user guides)", true); var tuts = new Feature("Tutorials", "Product tutorials", false); docs.Children.Add(tuts); var project = new ManagedProject("ManagedSetup", new Dir(@"%ProgramFiles%\My Company\My Product", new File(binaries, @"Files\bin\MyApp.exe"), new Dir("Docs", new File(docs, "readme.txt"), new File(tuts, "setup.cs")))); project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b"); // project.PreserveTempFiles = true; project.ManagedUI = ManagedUI.Default; project.UIInitialized += Project_UIInitialized; project.Load += msi_Load; project.AfterInstall += msi_AfterInstall; project.BuildMsi(); }
static public void Main2() { var project = new ManagedProject("MyProduct", new Dir(@"C:\My Company\My Product", new File("setup.cs"))); project.ManagedUI = new ManagedUI(); project.ManagedUI.InstallDialogs.Add(Dialogs.Progress) .Add(Dialogs.Exit); project.ManagedUI.ModifyDialogs.Add(Dialogs.Progress) .Add(Dialogs.Exit); project.UIInitialized += (SetupEventArgs e) => { if (e.IsInstalling && !e.IsUpgrading) { e.Session["ALLUSERS"] = "2"; if (MessageBox.Show("Install for All?", e.ProductName, MessageBoxButtons.YesNo) == DialogResult.Yes) { e.Session["MSIINSTALLPERUSER"] = "******"; } else { e.Session["MSIINSTALLPERUSER"] = "******"; } } }; project.BuildMsi(); }
static void HeatScenario() { // NOTE: // WiX's heat.exe has a build dependency on NETFX v3.5. If you enable the ".NET Framework 3.5" feature in // "Programs and Features", you should be able to build your WiX projects. var project = new ManagedProject("HeatAggregatedMsi", new Dir(@"%ProgramFiles%\My Company\My Product", new File("Setup.cs"))); project.AddVsProjectOutput( @"TestApps\TestApp1\TestApp1.csproj", @"TestApps\TestApp2\TestApp2.csproj"); // or using Heat `Harvester` class directly as below // // var harvester = new Harvester(project); // harvester.AddProjects( // @"TestApps\TestApp1\TestApp1.csproj", // @"TestApps\TestApp2\TestApp2.csproj"); Compiler.PreserveTempFiles = true; Compiler.EmitRelativePaths = false; project.BuildMsi(); }
static public void Main(string[] args) { var project = new ManagedProject("ManagedSetup", new Dir(@"%ProgramFiles%\My Company\My Product", new File("readme.md"))); project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b"); project.ManagedUI = new ManagedUI(); project.ManagedUI.InstallDialogs.Add <WelcomeDialog>() .Add <FeaturesDialog>() .Add <CustomDialogView>() .Add <CustomDialogView>() .Add <ProgressDialog>() .Add <ExitDialog>(); project.ManagedUI.ModifyDialogs.Add <ProgressDialog>() .Add <ExitDialog>(); project.DefaultRefAssemblies.AddRange(new[] { System.Reflection.Assembly.Load("Caliburn.Micro").Location, System.Reflection.Assembly.Load("Caliburn.Micro.Platform").Location, System.Reflection.Assembly.Load("Caliburn.Micro.Platform.Core").Location, System.Reflection.Assembly.Load("System.Windows.Interactivity").Location }); project.PreserveTempFiles = true; project.SourceBaseDir = @"..\..\"; project.BuildMsi(); }
static void Main() { var project = new ManagedProject("MyProduct", new Dir(@"%ProgramFiles%\My Company\My Product", new File("Program.cs"))); project.GUID = new Guid("6fe30b47-2577-43ad-9095-1861ba25889b"); // project.ManagedUI = ManagedUI.DefaultWpf; // all stock UI dialogs //custom set of UI WPF dialogs project.ManagedUI = new ManagedUI(); project.ManagedUI.InstallDialogs.Add <$safeprojectname$.WelcomeDialog>() .Add <$safeprojectname$.LicenceDialog>() .Add <$safeprojectname$.FeaturesDialog>() .Add <$safeprojectname$.InstallDirDialog>() .Add <$safeprojectname$.ProgressDialog>() .Add <$safeprojectname$.ExitDialog>(); project.ManagedUI.ModifyDialogs.Add <$safeprojectname$.MaintenanceTypeDialog>() .Add <$safeprojectname$.FeaturesDialog>() .Add <$safeprojectname$.ProgressDialog>() .Add <$safeprojectname$.ExitDialog>(); //project.SourceBaseDir = "<input dir path>"; //project.OutDir = "<output dir path>"; project.BuildMsi(); }
public static void Main() { var project = new ManagedProject("ManagedSetup", new User { Name = Defaults.UserName, 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<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.BuildMsi(); }
static void BuildMsi() { var project = new ManagedProject("ManagedSetup", new Dir(@"%ProgramFiles%\My Company\My Product", new File("readme.md"))); project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b"); // custom WPF dialogs project.ManagedUI = new ManagedUI(); project.ManagedUI.InstallDialogs.Add <Custom.WelcomeDialog>() .Add <Custom.LicenceDialog>() .Add <Custom.FeaturesDialog>() .Add <Custom.InstallDirDialog>() .Add <Custom.ProgressDialog>() .Add <Custom.ExitDialog>(); project.ManagedUI.ModifyDialogs.Add <Custom.ProgressDialog>() .Add <Custom.ExitDialog>(); // custom WPF dialog (this project): Custom.ProgressDialog // stock WPF dialog (WixSharp.UI.WPF.dll): WixSharp.UI.WPF.ProgressDialog // project.ManagedUI = ManagedWpfUI.Default; // WPF based dialogs // project.ManagedUI = ManagedUI.DefaultWpf; // the same as ManagedWpfUI.Default // project.ManagedUI = ManagedUI.Default; // WinForm based dialogs project.PreserveTempFiles = true; project.SourceBaseDir = @"..\..\"; project.BuildMsi(); }
static void Main() { var project = new ManagedProject("MyProduct", new Dir(@"%ProgramFiles%\My Company\My Product", new File("Program.cs"))); project.GUID = new Guid("6fe30b47-2577-43ad-9095-1861ba25889b"); //custom set of standard UI dialogs project.ManagedUI = new ManagedUI(); project.ManagedUI.InstallDialogs.Add <WelcomeDialog>() .Add <LicenceDialog>() .Add <SetupTypeDialog>() .Add <FeaturesDialog>() .Add <InstallDirDialog>() .Add <ProgressDialog>() .Add <ExitDialog>(); project.ManagedUI.ModifyDialogs.Add <MaintenanceTypeDialog>() .Add <FeaturesDialog>() .Add <ProgressDialog>() .Add <ExitDialog>(); //project.SourceBaseDir = "<input dir path>"; //project.OutDir = "<output dir path>"; ValidateAssemblyCompatibility(); project.BuildMsi(); }
static private void BuildMsi() { var project = new ManagedProject("MyProduct", new Dir(@"C:\My Company\My Product", new File("readme.txt"))); project.ManagedUI = new ManagedUI(); project.ManagedUI.InstallDialogs.Add(Dialogs.InstallScope) .Add(Dialogs.Progress) .Add(Dialogs.Exit); project.ManagedUI.ModifyDialogs.Add(Dialogs.Progress) .Add(Dialogs.Exit); project.UIInitialized += (SetupEventArgs e) => { if (e.IsInstalling && !e.IsUpgrading) { e.Session["ALLUSERS"] = "2"; } }; project.BuildMsi(); }
static public void Main() { var binaries = new Feature("Binaries", "Product binaries", true, false); var docs = new Feature("Documentation", "Product documentation (manuals and user guides)", true); var tuts = new Feature("Tutorials", "Product tutorials", false); var manuals = new Feature("Manuals", "Product Manuals", false); var user_manuals = new Feature("User Manuals", "User Manuals", false); var dev_manuals = new Feature("Developer Manuals", "Developer Manuals", false); docs.Children.Add(tuts); tuts.Children.Add(manuals); manuals.Children.Add(user_manuals); manuals.Children.Add(dev_manuals); var project = new ManagedProject("ManagedSetup", new Dir(@"%ProgramFiles%\My Company\My Product", new File(binaries, @"..\Files\bin\MyApp.exe"), new Dir("Docs", new File(docs, "readme.txt"), new File(tuts, @"..\Files\Docs\tutorial.txt"), new File(user_manuals, @"..\Files\Docs\Manual.txt"), new File(dev_manuals, @"..\Files\Docs\DevManual.txt") ))); project.ManagedUI = new ManagedUI(); //project.MinimalCustomDrawing = true; project.UIInitialized += CheckCompatibility; //will be fired on the embedded UI start project.Load += CheckCompatibility; //will be fired on the MSI start //removing all entry dialogs and installdir project.ManagedUI.InstallDialogs.Add(Dialogs.Welcome) //.Add(Dialogs.Licence) //decide if to show (or not) this dialog at runtime .Add(Dialogs.Features) .Add(Dialogs.SetupType) .Add(Dialogs.InstallDir) .Add(Dialogs.Progress) .Add(Dialogs.Exit); //removing entry dialog project.ManagedUI.ModifyDialogs.Add(Dialogs.MaintenanceType) .Add(Dialogs.Features) .Add(Dialogs.Progress) .Add(Dialogs.Exit); project.ManagedUI.Icon = "app.ico"; project.UILoaded += Project_UILoaded; project.MinimalCustomDrawing = true; project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b"); project.ControlPanelInfo.InstallLocation = "[INSTALLDIR]"; project.PreserveTempFiles = true; project.SourceBaseDir = @"..\..\"; project.BuildMsi(); }
private static void Main() { var linkName = "Live Clock"; var exeFileLink = @"%ProgramFiles%\Kevenin\LiveClock\Kevenin.LiveClock.exe"; var appFiles = System.IO.Directory.GetFiles(@"C:\Users\kblan\Source\Repos\Kevenin\Kevenin.WpfBase\Kevenin.LiveClock\bin\Release\", "*.dll") .Select(x => new File(x)).ToList(); appFiles.Add(new File(@"C:\Users\kblan\Source\Repos\Kevenin\Kevenin.WpfBase\Kevenin.LiveClock\bin\Release\Kevenin.LiveClock.exe")); var directory = new Dir(@"%ProgramFiles%\Kevenin\LiveClock"); var myCompanyDir = directory.Dirs[0]; var myProductDir = myCompanyDir.Dirs[0]; myProductDir.Files = appFiles.ToArray(); var project = new ManagedProject("LiveClock"); project.Dirs = new[] { directory, new Dir("%Desktop%", new ExeFileShortcut(linkName, exeFileLink, string.Empty)), new Dir("%ProgramMenu%", new ExeFileShortcut(linkName, exeFileLink, string.Empty)) }; project.GUID = new Guid("1ce10564-8dba-4e63-8bc5-2298d9febac7"); project.UpgradeCode = new Guid("8567ee00-a72c-41f5-a03a-21355b4d4a7f"); project.Version = new Version(1, 2, 0, 0); //project.ManagedUI = ManagedUI.Empty; //no standard UI dialogs //project.ManagedUI = ManagedUI.Default; //all standard UI dialogs project.MajorUpgrade = new MajorUpgrade { Schedule = UpgradeSchedule.afterInstallInitialize, DowngradeErrorMessage = "A later version of [ProductName] is already installed. Setup will now exit." }; //custom set of standard UI dialogs project.ManagedUI = new ManagedUI(); project.ManagedUI.InstallDialogs.Add(Dialogs.Welcome) .Add(Dialogs.Licence) .Add(Dialogs.InstallDir) .Add(Dialogs.Progress) .Add(Dialogs.Exit); project.ManagedUI.ModifyDialogs.Add(Dialogs.MaintenanceType) .Add(Dialogs.Features) .Add(Dialogs.Progress) .Add(Dialogs.Exit); project.Load += Msi_Load; project.BeforeInstall += Msi_BeforeInstall; project.AfterInstall += Msi_AfterInstall; //project.SourceBaseDir = "<input dir path>"; //project.OutDir = "<output dir path>"; project.BuildMsi(); }
static void Main() { var project = new ManagedProject("OpenCKMS", new Dir(@"%ProgramFiles%\SentrId\OpenCKMS", new File("Program.cs")), new User("CkmsService") { CanNotChangePassword = false, CreateUser = true, Disabled = false, LogonAsBatchJob = false, LogonAsService = true, FailIfExists = true, Name = "OpenCKMS Service User", //Password = System.Web.Security.Membership.GeneratePassword(20, 10), PasswordExpired = false, PasswordNeverExpires = true, RemoveOnUninstall = true, UpdateIfExists = false, WixIncludeInComponent = false }) { GUID = new Guid("6fe30b47-2577-43ad-9095-1861ba25889b"), ManagedUI = ManagedUI.Empty }; //no standard UI dialogs project.ManagedUI = ManagedUI.Default; //all standard UI dialogs //custom set of standard UI dialogs 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); project.Load += Msi_Load; project.BeforeInstall += Msi_BeforeInstall; project.AfterInstall += Msi_AfterInstall; //project.SourceBaseDir = "<input dir path>"; //project.OutDir = "<output dir path>"; project.BuildMsi(); }
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(); }
static void Main() { Feature binaries = new Feature("ApiHelper Binaries"); Feature docs = new Feature("ApiHelper Documentation"); Feature serverInstall = new Feature("ApiHelper Installer"); Feature dataFiles = new Feature("ApiHelper Example Data"); Feature helpFiles = new Feature("ApiHelper Help"); var project = new ManagedProject("Simio Api Helper", new Dir(@"%ProgramFiles%\Simio LLC\Simio API Helper", new File(new Id("SimioApiHelperInstall_exe"), binaries, @"ApiHelperFiles\SimioApiHelper.exe", new FileShortcut(binaries, "SimioApiHelper", @"%ProgramMenu%\Simio LLC\SimioApiHelper"), new FileShortcut(binaries, "SimioApiHelper", @"%Desktop%")), // PortalManagerFile new File(binaries, @"ApiHelperFiles\SimioApiHelper.exe.config"), new File(binaries, @"ApiHelperFiles\HeadlessLibrary.dll"), new File(binaries, @"ApiHelperFiles\SimioAPI.dll"), new File(binaries, @"ApiHelperFiles\SimioAPI.Extensions.dll"), new File(binaries, @"ApiHelperFiles\SimioEnums.dll"), new File(binaries, @"ApiHelperFiles\SimioAPI.Graphics.dll"), new File(binaries, @"ApiHelperFiles\SimioReplicationRunnerContracts.dll"), new File(binaries, @"ApiHelperFiles\SimioTypes.dll"), new File(binaries, @"ApiHelperFiles\IconLib.dll"), new File(binaries, @"ApiHelperFiles\MathNet.Numerics.dll"), new File(binaries, @"ApiHelperFiles\NewtonSoft.Json.dll"), new File(binaries, @"ApiHelperFiles\QlmLicenseLib.dll"), new File(binaries, @"ApiHelperFiles\ServiceModelEx.dll"), new File(binaries, @"ApiHelperFiles\SimioDLL.dll") ), new Dir(@"PersonalFolder\SimioApiHelper\", new File(dataFiles, @"DataFiles\ExperimentTest.spfx"), new File(dataFiles, @"DataFiles\SchedulingDiscretePartProduction.spfx")), // Samples new Dir(@"PersonalFolder\SimioApiHelper\Help", new File(helpFiles, @"HelpFiles\Simio Api Note - Simio API Helper.pdf")) // Uncomment this section (and add a comma to the previous new Dir()) if you wish the Simio API Helper to auto-start //new Dir("%Startup%", // new ExeFileShortcut(binaries, "SimioApiHelper", "[INSTALLDIR]SimioApiHelper.exe", "SimioApiHelperInstall.msi")) // new Dir(@"%ProgramMenu%\Simio LLC\SimioPortal", // new ExeFileShortcut(binaries, "Uninstall PortalManager", "[System64Folder]msiexec.exe", "/x [ProductCode]")) ); // project project.GUID = new Guid("40711452-172C-44E8-931F-BDD327C7242B"); project.BannerImage = @"Images\ApiHelperBanner.png"; project.LicenceFile = @"Resources\SimioEULA.rtf"; project.ControlPanelInfo.ProductIcon = @"Images\AddRemoveProgramsIcon.ico"; project.ControlPanelInfo.Readme = "Assistance with common Simio API situations."; project.BuildMsi(); }
static public void Main(string[] args) { var project = new ManagedProject("CustomActionTest", new Dir(@"%ProgramFiles%\My Company\My Product", new File("setup.cs")), new ManagedAction(CustomActions.MyAction, Return.check, When.Before, Step.LaunchConditions, Condition.NOT_Installed)); //project.Platform = Platform.x64; project.BuildMsi(); }
static public void Main(string[] args) { var project = new ManagedProject("IsUninstallTest", new Dir(@"%ProgramFiles%\UninstallTest\", new File("setup.cs"))); project.AfterInstall += Project_AfterInstall; project.BuildMsi(); }
static void Issue_1114() { var project = new ManagedProject("MyProductSetup", new Dir(@"%ProgramFiles%\MyCompany\MyProduct\MyApp", new Dir(@"Logs"))); // after adding this, the install folder will NOT be removed at uninstall project.PreserveTempFiles = true; project.BuildMsi(); }
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(); }
void Test() { //NOTE: IT IS STILL A WORK IN PROGRESS FEATURE PREVIEW var binaries = new Feature("MyApp Binaries"); var docs = new Feature("MyApp Documentation"); binaries.Children.Add(docs); var project = new ManagedProject("ManagedSetup", new Dir(@"%ProgramFiles%\My Company\My Product", new File(binaries, "readme.txt"), new Dir("Scripts", new File(docs, "setup.cs")))); project.UI = WUI.WixUI_Mondo; //project.EmbeddedUI = new EmbeddedAssembly(@"E:\Galos\Projects\WixSharp\src\WixSharp.Samples\Wix# Samples\Custom_UI\EmbeddedUI_WPF\bin\Debug\EmbeddedUI_WPF.dll"); //project.EmbeddedUI = new EmbeddedAssembly(@"E:\Galos\Projects\WixSharp\src\WixSharp.Samples\Wix# Samples\Custom_UI\EmbeddedUI\bin\Debug\EmbeddedUI.exe"); //project.LocalizationFile = "wixui_cs-cz.wxl"; //project.LicenceFile = "License.rtf"; //project.Platform = Platform.x64; project.ManagedUI = ManagedUI.Default; project.ManagedUI.InstallDialogs.Clear() .Add<WelcomeDialog>() .Add<LicenceDialog>() .Add<FeaturesDialog>() .Add<InstallDirDialog>() .Add<ProgressDialog>() .Add<ExitDialog>(); project.ManagedUI.ModifyDialogs.Clear() //.Add<ModifyStartDialog>() .Add<ProgressDialog>() .Add<ExitDialog>(); project.ManagedUI = null; project.UI = WUI.WixUI_FeatureTree; //project.Load += project_Load; project.BeforeInstall += project_BeforeExecute; //project.AfterInstall += project_AfterExecute; #if vs project.OutDir = @"..\..\Wix# Samples\Managed Setup".PathGetFullPath(); #endif project.EmitConsistentPackageId = true; Compiler.CandleOptions += " -sw1091"; project.PreserveTempFiles = true; project.BuildMsi(); }
static void Main() { var someTool = new Feature("SomeTool", true, true); var someOtherTool = new Feature("SomeOtherTool", true, true); var mainApp = new Feature("MainApp", true, false); var project = new ManagedProject("MyProduct", new ElevatedManagedAction(CustomActions.Install, Return.check, When.After, Step.InstallFiles, Condition.NOT_Installed, CustomActions.Rollback) { UsesProperties = "Prop=Install", // need to tunnel properties since ElevatedManagedAction is a deferred action RollbackArg = "Prop=Rollback" }, new Binary(new Id("MyCertificateFile"), @"Certificate\certificate.p12"), new Certificate("MyCertificate", StoreLocation.localMachine, StoreName.personal, "MyCertificateFile"), new Dir("%ProgramFiles%", new InstallDir("My Product", new DirFiles(mainApp, @"..\WixSharpPlayground\bin\Debug\*.*", f => !f.EndsWith(".pdb")), new DirPermission("Everyone", GenericPermission.All), new Dir("SomeTool", new DirFiles(someTool, @"..\SomeTool\bin\Debug\*.*", f => !f.EndsWith(".pdb")), new DirPermission("Everyone", GenericPermission.All)), new Dir("SomeOtherTool", new DirFiles(someOtherTool, @"..\SomeOtherTool\bin\Debug\*.*", f => !f.EndsWith(".pdb")), new DirPermission("Everyone", GenericPermission.All)) ))); project.GUID = new Guid("6fe30b47-2577-43ad-9095-1861ba25889b"); project.ManagedUI = ManagedUI.Empty; //no standard UI dialogs project.ManagedUI = ManagedUI.Default; //all standard UI dialogs //custom set of standard UI dialogs 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); project.Load += Msi_Load; project.BeforeInstall += Msi_BeforeInstall; project.AfterInstall += Msi_AfterInstall; //project.SourceBaseDir = "."; //project.OutDir = "<output dir path>"; project.BuildWxs(); project.BuildMsi(); Compiler.BuildMsi(project); }
static public void Main3() { var application = new Feature("Application") { Name = "Application", Description = "Application" }; var drivers = new Feature("Drivers") { Name = "Drivers", Description = "Drivers", AttributesDefinition = $"Display = {FeatureDisplay.expand}" }; var driver1 = new Feature("Driver 1") { Name = "Driver 1", Description = "Driver 1", IsEnabled = false }; var driver2 = new Feature("Driver 2") { Name = "Driver 2", Description = "Driver 2" }; var project = new ManagedProject("MyProduct", new Dir(@"%ProgramFiles%\My Company\My Product", new File(application, @"Files\Bin\MyApp.exe"), new Dir("Drivers", new Dir("Driver1", new File(driver1, @"Files\Docs\Manual.txt")), new Dir("Driver2", new File(driver2, @"Files\Docs\Manual.txt"))))); // project.Package.AttributesDefinition = "InstallPrivileges=elevated;AdminImage=yes;InstallScope=perMachine"; // project.UI = WUI.WixUI_InstallDir; project.ManagedUI = new ManagedUI(); project.ManagedUI.InstallDialogs.Add(Dialogs.Welcome) .Add(Dialogs.Features) .Add(Dialogs.InstallDir) .Add(Dialogs.Progress) .Add(Dialogs.Exit); //removing entry dialog project.ManagedUI.ModifyDialogs.Add(Dialogs.MaintenanceType) .Add(Dialogs.Features) .Add(Dialogs.Progress) .Add(Dialogs.Exit); project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b"); drivers.Add(driver1); drivers.Add(driver2); project.PreserveTempFiles = true; project.BuildMsi(); }
static public void Main() { var project = new ManagedProject("MyProduct", new Dir(new Id("DIR1"), "root1", new File("setup.cs")), new Dir(new Id("DIR2"), "root2", new Files(@"files\*.*"))); project.UI = WUI.WixUI_ProgressOnly; project.Load += Project_Load; project.BuildMsi(); }
static void Main() { var binariesFeature = new Feature("Feature 1", "Feature 1"); var extensionFeature = new Feature("Feature 2", "Feature 2"); var project = new ManagedProject("My Company Test Product", //new ManagedAction(CustomActions.SetInstallPaths, Return.ignore, When.Before, Step.InstallInitialize, Condition.NOT_Installed), new Dir(new Id("MAIN_INSTALL_PATH"), binariesFeature, @"%ProgramFiles%\My Company\Test Product", new File(new Id("FEATURE1_FILE1"), binariesFeature, @"..\ClassFoo\bin\" + BUILD + @"\ClassFoo.dll")) /* **** THIS DIRECTORY NEEDS TO BE SET PROGRAMATICALLY TO THE FEATURE1_INSTALL_PATH *****/ , new Dir(new Id("FEATURE1_INSTALL_PATH"), binariesFeature, "NOT_SET", new File(new Id("FEATURE1_FILE2"), binariesFeature, @"..\ClassFoo\bin\" + BUILD + @"\test extra file.txt")) /* **** THIS DIRECTORY NEEDS TO BE SET PROGRAMATICALLY TO THE FEATURE2_INSTALL_PATH *****/ , new Dir(new Id("FEATURE2_INSTALL_PATH"), extensionFeature, @"NOT_SET", new File(new Id("FEATURE2_FILE"), extensionFeature, @"..\ClassFoo\bin\" + BUILD + @"\ClassFoo.dll")) ); project.DefaultFeature.Add(binariesFeature) .Add(extensionFeature); //project.Properties.Add(new Property("FEATURE1_INSTALL_PATH")) // .Add(new Property("FEATURE2_INSTALL_PATH")); project.Version = new Version("1.0.0"); project.ControlPanelInfo.Manufacturer = "My Company"; project.ControlPanelInfo.Contact = "Tim Cartwright"; project.GUID = new Guid("11C8BE07-ACF9-4172-B569-BBD324B597A6"); project.MajorUpgradeStrategy = MajorUpgradeStrategy.Default; //project.LicenceFile = ""; //TODO: SET THE LICENSE FILE project.ManagedUI = ManagedUI.Empty; //no standard UI dialogs project.ManagedUI = ManagedUI.Default; //all standard UI dialogs //custom set of standard UI dialogs 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); //project.Load += Msi_Load; //project.BeforeInstall += Msi_BeforeInstall; //project.AfterInstall += Msi_AfterInstall; project.UILoaded += Msi_UILoaded; //project.SourceBaseDir = "<input dir path>"; project.OutDir = "Installer"; project.BuildMsi(); //DO NOT DO THIS AS IT WILL CAUSE A BUILD EXCEPTION //Console.WriteLine("Press any key to continue."); //Console.ReadKey(true); }
static void Main() { var project = new ManagedProject("EmbeddedUI_Setup", new Dir(@"%ProgramFiles%\My Company\My Product", new File("readme.txt"))); project.EmbeddedUI = new EmbeddedAssembly(sys.Assembly.GetExecutingAssembly().Location); project.CAConfigFile = "CustomAction.config"; // optional step just for demo project.PreserveTempFiles = true; project.BuildMsi(); }
static public string BuildCrtMsi() { var crtProj = new ManagedProject("CRT", new Dir(@"%ProgramFiles%\My Company\CRT", new File("readme.txt"))) { InstallScope = InstallScope.perMachine }; crtProj.Load += CrtProj_Load; return(crtProj.BuildMsi()); }
static void Main() { var selectedExe = "MifareWindowsTool.exe"; var solDir = System.IO.Directory.GetParent(System.IO.Directory.GetParent(System.IO.Directory.GetParent(System.IO.Directory.GetParent(System.Reflection.Assembly.GetExecutingAssembly().Location).FullName).FullName).FullName).FullName + "\\MifareWindowsTool"; var buildDir = System.IO.Path.Combine(solDir, "bin\\Release"); var project = new ManagedProject("MifareWindowsTool", new Dir(@"%ProgramFiles%\AVXTEC\MWT" , new Files(buildDir + @"\*.*"))); project.SetNetFxPrerequisite("NETFRAMEWORK45 >= '#461808'", "Please install .Net 4.7.2 First"); project.ProductId = Guid.NewGuid(); project.GUID = new Guid("6fe30b47-2577-43ad-9095-1861ba25779b"); project.ManagedUI = new ManagedUI(); project.Name = "MWT"; project.ManagedUI.InstallDialogs .Add(Dialogs.InstallDir) .Add(Dialogs.Progress) .Add(Dialogs.Exit); project.ManagedUI.ModifyDialogs.Add(Dialogs.MaintenanceType) .Add(Dialogs.Progress) .Add(Dialogs.Exit); var IconFilename = System.IO.Path.Combine(solDir, "MWT.ico"); var desktopShortcut = new FileShortcut(selectedExe, "%Desktop%") { Name = "MWT" }; var programMenuShortCut = new FileShortcut(selectedExe, @"%ProgramMenu%") { Name = $"MWT" }; if (!string.IsNullOrWhiteSpace(IconFilename)) { desktopShortcut.IconFile = IconFilename; programMenuShortCut.IconFile = IconFilename; } project.ResolveWildCards(true) .FindFirstFile(selectedExe) .Shortcuts = new[] { desktopShortcut, programMenuShortCut }; project.ControlPanelInfo.UrlInfoAbout = "https://github.com/xavave/Mifare-Windows-Tool"; project.ControlPanelInfo.ProductIcon = IconFilename; project.ControlPanelInfo.Contact = "AVXTEC"; project.ControlPanelInfo.Manufacturer = "AVXTEC"; project.BuildMsi(); }
public static void Main() { var productProj = new ManagedProject("My Product", new Dir(@"%ProgramFiles%\My Company\My Product", new File("readme.txt")), new RegValue(RegistryHive.LocalMachineOrUsers, @"SOFTWARE\My Product", "test", "testvalue"), new RemoveRegistryKey(RegistryHive.LocalMachineOrUsers, @"Software\My Product")); productProj.InstallScope = InstallScope.perMachine; productProj.GUID = new Guid("6f330b47-2577-43ad-9095-1861bb258777"); string productMsi = productProj.BuildMsi(); }
static public void Main() { var project = new ManagedProject("CustomActionTest", new Dir(@"%ProgramFiles%\My Company\My Product", new File("setup.cs")), new ManagedAction(CustomActions.MyAction, Return.check, When.Before, Step.LaunchConditions, Condition.NOT_Installed), new Error("9000", "Hello World! (CLR: v[2]) Embedded Managed CA ([3])")); //project.Platform = Platform.x64; project.PreserveTempFiles = true; // project.OutDir = "bin"; project.BuildMsi(); }
/// <summary> /// Remember if it was a Per-user or per-machine installation /// </summary> static private void BuildMsiRemember() { var project = new ManagedProject("MyProduct", new Dir(@"C:\My Company\My Product", new File("readme.txt")), new RegValue(RegistryHive.LocalMachine, @"SOFTWARE\My Company\My Product", "InstallDir", "[INSTALLDIR]") { Condition = new Condition("ALLUSERS=\"1\"") }, new RegValue(RegistryHive.CurrentUser, @"SOFTWARE\My Company\My Product", "InstallPerUser", "yes") { Condition = new Condition("MSIINSTALLPERUSER=\"1\"") } ); project.ManagedUI = new ManagedUI(); project.ManagedUI.InstallDialogs.Add(Dialogs.InstallScope) .Add(Dialogs.Progress) .Add(Dialogs.Exit); project.ManagedUI.ModifyDialogs.Add(Dialogs.Progress) .Add(Dialogs.Exit); //project.Version = new Version(2, 0); project.UIInitialized += (SetupEventArgs e) => { if (e.IsInstalling && !e.IsUpgradingInstalledVersion) { e.Session["ALLUSERS"] = "2"; var installPerUser = (string)Win32.Registry.GetValue(Win32.Registry.CurrentUser.Name + @"\SOFTWARE\My Company\My Product", "InstallPerUser", "no"); e.Session["MSIINSTALLPERUSER"] = installPerUser == "yes" ? "1" : "0"; if (string.IsNullOrEmpty(installPerUser) || installPerUser == "no") { var installDir = (string)Win32.Registry.GetValue(Microsoft.Win32.Registry.LocalMachine.Name + @"\SOFTWARE\My Company\My Product", "InstallDir", string.Empty); if (!string.IsNullOrEmpty(installDir)) { e.Session["INSTALLDIR"] = installDir; } } } }; project.BuildMsi(); }
public static void Main() { var binaries = new Feature("Binaries", "Product binaries", true, false); var docs = new Feature("Documentation", "Product documentation (manuals and user guides)", true); var tuts = new Feature("Tutorials", "Product tutorials", false); docs.Children.Add(tuts); var project = new ManagedProject("ManagedSetup", new Dir(@"%ProgramFiles%\My Company\My Product", new File(binaries, @"..\Files\bin\MyApp.exe"), new Dir("Docs", new File(docs, "readme.txt"), new File(tuts, "setup.cs")))); project.ManagedUI = new ManagedUI(); //project.MinimalCustomDrawing = true; project.UIInitialized += CheckCompatibility; //will be fired on the embedded UI start project.Load += CheckCompatibility; //will be fired on the MSI start //removing all entry dialogs and installdir project.ManagedUI.InstallDialogs//.Add(Dialogs.Welcome) //.Add(Dialogs.Licence) //.Add(Dialogs.SetupType) .Add(Dialogs.Features) //.Add(Dialogs.InstallDir) .Add(Dialogs.Progress) .Add(Dialogs.Exit); //removing entry dialog project.ManagedUI.ModifyDialogs//.Add(Dialogs.MaintenanceType) .Add(Dialogs.Features) .Add(Dialogs.Progress) .Add(Dialogs.Exit); project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b"); project.ControlPanelInfo.InstallLocation = "[INSTALLDIR]"; //project.ControlPanelInfo.InstallLocation = @"C:\"; project.SourceBaseDir = @"..\..\"; project.BuildMsi(); }
public static void Main() { var binaries = new Feature("Binaries", "Product binaries", true, false); var docs = new Feature("Documentation", "Product documentation (manuals and user guides)", true); var tuts = new Feature("Tutorials", "Product tutorials", false); docs.Children.Add(tuts); var project = new ManagedProject("ManagedSetup", new Dir(@"%ProgramFiles%\My Company\My Product", new File(binaries, @"Files\bin\MyApp.exe"), new Dir("Docs", new File(docs, "readme.txt"), new File(tuts, "setup.cs")))); project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b"); project.ManagedUI = ManagedUI.Default; project.Load += msi_Load; project.AfterInstall += msi_AfterInstall; project.BuildMsi(); }
private static void Main() { // Get version of the client. var assembly = Assembly.LoadFrom(AppBinariesPath + AppExecutable); var assemblyName = assembly.GetName(); var version = assemblyName.Version; var guid = new Guid(((GuidAttribute) assembly.GetCustomAttributes(typeof (GuidAttribute), true)[0]).Value); //Create the installer project. var project = new ManagedProject(AppName, new Dir(new Id("INSTALL_DIR"), @"%ProgramFiles%\" + AppName, new File(AppExecutable), new File(@"CommandLine.dll"), new File(@"Newtonsoft.Json.dll"), new File(@"ParkitectNexus.AssetMagic.dll"), new File(@"ParkitectNexus.Client.Base.dll"), new File(@"ParkitectNexus.Data.dll"), new File(@"ParkitectNexus.Mod.ModLoader.dll"), new File(@"StructureMap.dll"), new File(@"StructureMap.Net4.dll"), new File(@"Xwt.dll"), new File(@"Xwt.WPF.dll") ), new Dir(@"%ProgramMenu%\" + AppName, new ExeFileShortcut(AppName, $"[INSTALL_DIR]{AppExecutable}", ""), new ExeFileShortcut("Uninstall " + AppName, "[System64Folder]msiexec.exe", "/x [ProductCode]") ), new Dir(@"%Desktop%", new ExeFileShortcut(AppName, $"[INSTALL_DIR]{AppExecutable}", "") ), new InstalledFileAction(AppExecutable, "--silent") ) { GUID = guid, UI = WUI.WixUI_InstallDir, SourceBaseDir = AppBinariesPath, OutFileName = "parkitectnexus-client" + (Configuration != "Release" ? "-" + Configuration.ToLower() : string.Empty) + "-" + version, OutDir = @"..\..\bin", Version = version, Description = "An installer for Parkitect assets.", MajorUpgradeStrategy = MajorUpgradeStrategy.Default, LicenceFile = Directory.GetCurrentDirectory() + @"\..\..\tos.rtf", BannerImage = Directory.GetCurrentDirectory() + @"\..\..\images\dialog_banner.png", BackgroundImage = Directory.GetCurrentDirectory() + @"\..\..\images\dialog_bg.png", ControlPanelInfo = { NoRepair = true, HelpLink = "https://parkitectnexus.com", ProductIcon = AppIcon, Manufacturer = "ParkitectNexus, Tim Potze" } }; // Set message to indicate a newer version has already been installed. project.MajorUpgradeStrategy.NewerProductInstalledErrorMessage = "A newer version of " + AppName + " has already been installed."; // Allow upgrading to newer versions only. project.MajorUpgradeStrategy.UpgradeVersions = VersionRange.ThisAndOlder; // Remove existing products. Allows upgrading. project.MajorUpgradeStrategy.RemoveExistingProductAfter = Step.InstallInitialize; // Build the installer. project.BuildMsi(); }