diff --git a/Source/NuGet/WixSharp/WixSharp.WPF.nuspec b/Source/NuGet/WixSharp/WixSharp.WPF.nuspec index b588498c..dd589285 100644 --- a/Source/NuGet/WixSharp/WixSharp.WPF.nuspec +++ b/Source/NuGet/WixSharp/WixSharp.WPF.nuspec @@ -2,7 +2,7 @@ WixSharp.WPF - 2.1.7.0 + 2.2.0.0 Wix# (WixSharp) - Binaries Oleg Shilo Oleg Shilo @@ -16,20 +16,13 @@ The package contains Wix# binaries only. In order to use this package you need have WiX Toolset installed. The package is tested against WIX (Windows Installer Xml) Toolset v3.10 (v3.10.2103.0) Wix# (WixSharp) - Binaries - WiX4 - Release v2.1.7.0 - -Special thanks to @geghamyan for contributing `Project.SignAllFiles` functionality. - -- Added file signing functionality to project build process (`Project.SignAllFiles`). -- Added WiX5 new attributes (known at the time) for `FirewallException`' -- Issue #1533: Allow specifying the Group name when adding a FirewallException -- WixSharp.Core: Added EmbeddedUI sample solution + Release v2.2.0.0 Copyright (C) 2008-2021 Oleg Shilo en-AU C# scripting msi install setup wix - + diff --git a/Source/NuGet/WixSharp/WixSharp.bin.nuspec b/Source/NuGet/WixSharp/WixSharp.bin.nuspec index 1b222802..c91b82a9 100644 --- a/Source/NuGet/WixSharp/WixSharp.bin.nuspec +++ b/Source/NuGet/WixSharp/WixSharp.bin.nuspec @@ -2,7 +2,7 @@ WixSharp.bin - 2.1.7.0 + 2.2.0.0 Wix# (WixSharp) - Binaries Oleg Shilo Oleg Shilo @@ -16,14 +16,7 @@ The package contains Wix# binaries only. In order to use this package you need have WiX Toolset installed. The package is tested against WIX (Windows Installer Xml) Toolset v3.10 (v3.10.2103.0) Wix# (WixSharp) - Binaries - WiX4 - Release v2.1.7.0 - -Special thanks to @geghamyan for contributing `Project.SignAllFiles` functionality. - -- Added file signing functionality to project build process (`Project.SignAllFiles`). -- Added WiX5 new attributes (known at the time) for `FirewallException`' -- Issue #1533: Allow specifying the Group name when adding a FirewallException -- WixSharp.Core: Added EmbeddedUI sample solution + Release v2.2.0.0 Copyright (C) 2008-2022 Oleg Shilo en-AU diff --git a/Source/NuGet/WixSharp/WixSharp.nuspec b/Source/NuGet/WixSharp/WixSharp.nuspec index 15b96f01..7a9ecb89 100644 --- a/Source/NuGet/WixSharp/WixSharp.nuspec +++ b/Source/NuGet/WixSharp/WixSharp.nuspec @@ -2,7 +2,7 @@ WixSharp - 2.1.7.0 + 2.2.0.0 Wix# (WixSharp) - managed interface for WiX Oleg Shilo Oleg Shilo @@ -18,20 +18,13 @@ If you need only Wix# binaries you may want to use WixSharp.bin package instead. In order to use this package you need have WiX Toolset installed. The package is tested against WIX (Windows Installer Xml) Toolset v3.10 (v3.10.2103.0) Wix# (WixSharp) - Binaries - WiX4 - Release v2.1.7.0 - -Special thanks to @geghamyan for contributing `Project.SignAllFiles` functionality. - -- Added file signing functionality to project build process (`Project.SignAllFiles`). -- Added WiX5 new attributes (known at the time) for `FirewallException`' -- Issue #1533: Allow specifying the Group name when adding a FirewallException -- WixSharp.Core: Added EmbeddedUI sample solution + Release v2.2.0.0 Copyright (C) 2008-2022 Oleg Shilo en-AU C# scripting msi install setup wix - + diff --git a/Source/NuGet/WixSharp/WixSharp_wix4.WPF.nuspec b/Source/NuGet/WixSharp/WixSharp_wix4.WPF.nuspec index 4d36cdb6..a9ef4ecd 100644 --- a/Source/NuGet/WixSharp/WixSharp_wix4.WPF.nuspec +++ b/Source/NuGet/WixSharp/WixSharp_wix4.WPF.nuspec @@ -2,7 +2,7 @@ WixSharp-wix4.WPF - 2.1.7.0 + 2.2.0.0 Wix# (WixSharp) - Binaries Oleg Shilo Oleg Shilo @@ -16,20 +16,38 @@ The package contains Wix# binaries only. In order to use this package you need have WiX Toolset installed: `dotnet tool install --global wix` The package is tested against WIX (Windows Installer Xml) Toolset v4.0.1.0 Wix# (WixSharp) - Binaries - WiX4 - Release v2.1.7.0 - -Special thanks to @geghamyan for contributing `Project.SignAllFiles` functionality. - -- Added file signing functionality to project build process (`Project.SignAllFiles`). -- Added WiX5 new attributes (known at the time) for `FirewallException`' -- Issue #1533: Allow specifying the Group name when adding a FirewallException -- WixSharp.Core: Added EmbeddedUI sample solution + Release v2.2.0.0 +- Implemented `MsiExePackage`. Triggered by #1554 + The dedicated sample `WixBootstrapper_MsiEmbeddedUI` shows how to use it + ```C# + var bootstrapper = + new Bundle("Managed Product Bundle", + new MsiExePackage(msi) + { + Name = "ManagedProduct", + }); + ``` + +- Issue #1557: Error when specifying Package Platform as ARM64 +- Added `restart elevated` routine for custom BA sample +- Added `WixProject.WixBuildCommandGenerated` event. Can be used to manipulate `wix.exe` command line arguments. Triggered by #1557 +- Added `CommonTasks.MapAsDeferredProperty` extension method: + ```C# + project.MapAsDeferredProperty("MYPROPERTY"); + // instead of + project.DefaultDeferredProperties += ",MYPROPERTY"; + ``` +- Added `string.CompleSelfHostedMsi` extension for building self executable msi files: + ```C# + msi.CompleSelfHostedMsi(msi + ".exe"); + ``` +- added calling `dotnet tool restore` when using wix as a local tool. Triggered by #1546 Copyright (C) 2008-2023 Oleg Shilo en-AU C# scripting msi install setup wix - + diff --git a/Source/NuGet/WixSharp/WixSharp_wix4.bin.nuspec b/Source/NuGet/WixSharp/WixSharp_wix4.bin.nuspec index a71bd2e2..0c5d708f 100644 --- a/Source/NuGet/WixSharp/WixSharp_wix4.bin.nuspec +++ b/Source/NuGet/WixSharp/WixSharp_wix4.bin.nuspec @@ -2,7 +2,7 @@ WixSharp_wix4.bin - 2.1.7.0 + 2.2.0.0 Wix# (WixSharp) - Binaries Oleg Shilo Oleg Shilo @@ -16,14 +16,32 @@ The package contains Wix# binaries only. In order to use this package you need have WiX Toolset installed: `dotnet tool install --global wix` The package is tested against WIX (Windows Installer Xml) Toolset v4.0.1.0 Wix# (WixSharp) - Binaries - WiX4 - Release v2.1.7.0 - -Special thanks to @geghamyan for contributing `Project.SignAllFiles` functionality. - -- Added file signing functionality to project build process (`Project.SignAllFiles`). -- Added WiX5 new attributes (known at the time) for `FirewallException`' -- Issue #1533: Allow specifying the Group name when adding a FirewallException -- WixSharp.Core: Added EmbeddedUI sample solution + Release v2.2.0.0 +- Implemented `MsiExePackage`. Triggered by #1554 + The dedicated sample `WixBootstrapper_MsiEmbeddedUI` shows how to use it + ```C# + var bootstrapper = + new Bundle("Managed Product Bundle", + new MsiExePackage(msi) + { + Name = "ManagedProduct", + }); + ``` + +- Issue #1557: Error when specifying Package Platform as ARM64 +- Added `restart elevated` routine for custom BA sample +- Added `WixProject.WixBuildCommandGenerated` event. Can be used to manipulate `wix.exe` command line arguments. Triggered by #1557 +- Added `CommonTasks.MapAsDeferredProperty` extension method: + ```C# + project.MapAsDeferredProperty("MYPROPERTY"); + // instead of + project.DefaultDeferredProperties += ",MYPROPERTY"; + ``` +- Added `string.CompleSelfHostedMsi` extension for building self executable msi files: + ```C# + msi.CompleSelfHostedMsi(msi + ".exe"); + ``` +- added calling `dotnet tool restore` when using wix as a local tool. Triggered by #1546 Copyright (C) 2008-2023 Oleg Shilo en-AU diff --git a/Source/NuGet/WixSharp/WixSharp_wix4.nuspec b/Source/NuGet/WixSharp/WixSharp_wix4.nuspec index b853838f..c456bef9 100644 --- a/Source/NuGet/WixSharp/WixSharp_wix4.nuspec +++ b/Source/NuGet/WixSharp/WixSharp_wix4.nuspec @@ -2,7 +2,7 @@ WixSharp_wix4 - 2.1.7.0 + 2.2.0.0 Wix# (WixSharp) - managed interface for WiX Oleg Shilo Oleg Shilo @@ -18,20 +18,39 @@ If you need only Wix# binaries you may want to use WixSharp.bin package instead. In order to use this package you need have WiX Toolset installed: `dotnet tool install --global wix` The package is tested against WIX (Windows Installer Xml) Toolset v4.0.1.0 Wix# (WixSharp) - Binaries - WiX4 - Release v2.1.7.0 + Release v2.2.0.0 +- Implemented `MsiExePackage`. Triggered by #1554 + The dedicated sample `WixBootstrapper_MsiEmbeddedUI` shows how to use it + ```C# + var bootstrapper = + new Bundle("Managed Product Bundle", + new MsiExePackage(msi) + { + Name = "ManagedProduct", + }); + ``` + +- Issue #1557: Error when specifying Package Platform as ARM64 +- Added `restart elevated` routine for custom BA sample +- Added `WixProject.WixBuildCommandGenerated` event. Can be used to manipulate `wix.exe` command line arguments. Triggered by #1557 +- Added `CommonTasks.MapAsDeferredProperty` extension method: + ```C# + project.MapAsDeferredProperty("MYPROPERTY"); + // instead of + project.DefaultDeferredProperties += ",MYPROPERTY"; + ``` +- Added `string.CompleSelfHostedMsi` extension for building self executable msi files: + ```C# + msi.CompleSelfHostedMsi(msi + ".exe"); + ``` +- added calling `dotnet tool restore` when using wix as a local tool. Triggered by #1546 -Special thanks to @geghamyan for contributing `Project.SignAllFiles` functionality. - -- Added file signing functionality to project build process (`Project.SignAllFiles`). -- Added WiX5 new attributes (known at the time) for `FirewallException`' -- Issue #1533: Allow specifying the Group name when adding a FirewallException -- WixSharp.Core: Added EmbeddedUI sample solution Copyright (C) 2008-2023 Oleg Shilo en-AU C# scripting msi install setup wix - + diff --git a/Source/src/NET-Core/WixSharp.Core/WixSharp.Core.csproj b/Source/src/NET-Core/WixSharp.Core/WixSharp.Core.csproj index 0f91fbe6..fd83f7a5 100644 --- a/Source/src/NET-Core/WixSharp.Core/WixSharp.Core.csproj +++ b/Source/src/NET-Core/WixSharp.Core/WixSharp.Core.csproj @@ -13,12 +13,12 @@ True True snupkg - 2.1.4 - 2.1.5 + 2.2.0 + 2.2.0 - 2.1.9 + 2.2.0 WixSharp (.NET Core) .NET Core edition of WixSharp package Oleg Shilo @@ -200,6 +200,14 @@ + + + + + + + + diff --git a/Source/src/NET-Core/WixSharp.Msi.Core/WixSharp.Msi.Core.csproj b/Source/src/NET-Core/WixSharp.Msi.Core/WixSharp.Msi.Core.csproj index 9038b80e..21d94a10 100644 --- a/Source/src/NET-Core/WixSharp.Msi.Core/WixSharp.Msi.Core.csproj +++ b/Source/src/NET-Core/WixSharp.Msi.Core/WixSharp.Msi.Core.csproj @@ -24,7 +24,7 @@ - 2.1.9 + 2.2.0 WixSharp (.NET Core) .NET Core edition of WixSharp.Msi package Oleg Shilo diff --git a/Source/src/WixSharp.Samples/Wix# Samples/Install Files/setup.cs b/Source/src/WixSharp.Samples/Wix# Samples/Install Files/setup.cs index 8ee5b3e0..f120c5b7 100644 --- a/Source/src/WixSharp.Samples/Wix# Samples/Install Files/setup.cs +++ b/Source/src/WixSharp.Samples/Wix# Samples/Install Files/setup.cs @@ -22,10 +22,12 @@ static public void Main() var project = new ManagedProject("MyProduct", - new Dir(@"AppDataFolder\My ICompany\My Product", - // new Dir(new Id("MY_INSTALLDIR"), @"%ProgramFiles%\My ICompany\My Product", + // new Dir(@"AppDataFolder\My ICompany\My Product", + new Dir(new Id("MY_INSTALLDIR"), @"%ProgramFiles%\My ICompany\My Product", f = new File("MyApp_file".ToId(), - @"Files\Bin\MyApp.exe", + @"C:\sourceFiles\MyApp.exe", + // @"Files\Bin\MyApp.exe", + // @"D:\dev\wixsharp-wix4\Source\src\WixSharp.Samples\Wix# Samples\Install Files\Files\Bin\MyApp.exe", new FileAssociation("cstm", "application/custom", "open", "\"%1\"") { Advertise = true, @@ -35,7 +37,8 @@ static public void Main() TargetFileName = "app.exe" }, new Dir(@"Docs\Manual", - new File(@"Files\Docs\Manual.txt") + // new File(@"Files\Docs\Manual.txt") + new File(@"D:\dev\wixsharp-wix4\Source\src\WixSharp.Samples\Wix# Samples\Install Files\Files\Docs\Manual.txt") { NeverOverwrite = true })), @@ -44,7 +47,7 @@ static public void Main() project.SetVersionFrom("MyApp_file"); project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b"); - + Compiler.EmitRelativePaths = false; // possible UIs project.ManagedUI = ManagedUI.Default; // project.ManagedUI = ManagedUI.DefaultWpf; diff --git a/Source/src/WixSharp.Samples/Wix# Samples/InstallEventElevation/setup.cs b/Source/src/WixSharp.Samples/Wix# Samples/InstallEventElevation/setup.cs index 710f4a34..fde62833 100644 --- a/Source/src/WixSharp.Samples/Wix# Samples/InstallEventElevation/setup.cs +++ b/Source/src/WixSharp.Samples/Wix# Samples/InstallEventElevation/setup.cs @@ -13,6 +13,7 @@ using WixSharp; using WixSharp.CommonTasks; using WixSharp.UI; +using WixToolset.Dtf.WindowsInstaller; static class Script { @@ -27,20 +28,29 @@ static public void Main() project.UI = WUI.WixUI_ProgressOnly; - // project.Scope = InstallScope.perMachine; - project.Scope = InstallScope.perUser; - project.BeforeInstall += Project_BeforeInstall; - project.AfterInstall += Project_AfterInstall; + project.AfterInstall += Project_AfterInstall; // is already elevated (deferred by default) + + bool installPerUser = false; + if (installPerUser) + { + project.Scope = InstallScope.perUser; + project.BeforeInstallEventExecution = EventExecution.ExternalElevatedProcess; + } + else + { + project.Scope = InstallScope.perMachine; + project.BeforeInstallEventExecution = EventExecution.MsiSessionScopeDeferred; + // you can use ExternalElevatedProcess too + } - project.BeforeInstallEventExecution = EventExecution.ExternalElevatedProcess; project.BuildMsi(); } private static void Project_BeforeInstall(SetupEventArgs e) { MessageBox.Show(e.ToString(), "Project_BeforeInstall"); - // e.Result = WixToolset.Dtf.WindowsInstaller.ActionResult.UserExit; + e.Result = ActionResult.UserExit; // canceling the install here } private static void Project_AfterInstall(SetupEventArgs e) diff --git a/Source/src/WixSharp.Samples/Wix# Samples/Managed Setup/CustomUI.WPF/CustomWpfDialog.xaml.cs b/Source/src/WixSharp.Samples/Wix# Samples/Managed Setup/CustomUI.WPF/CustomWpfDialog.xaml.cs index 723afed2..bf21ec27 100644 --- a/Source/src/WixSharp.Samples/Wix# Samples/Managed Setup/CustomUI.WPF/CustomWpfDialog.xaml.cs +++ b/Source/src/WixSharp.Samples/Wix# Samples/Managed Setup/CustomUI.WPF/CustomWpfDialog.xaml.cs @@ -1,6 +1,7 @@ -using Caliburn.Micro; -using System; +using System; +using System.Windows; using System.Windows.Media.Imaging; +using Caliburn.Micro; using WixSharp; using WixSharp.UI.Forms; using WixSharp.UI.WPF; @@ -16,6 +17,12 @@ public CustomDialogView() public void Init() { + var topWindow = this.ManagedFormHost.Parent as System.Windows.Forms.Form; + topWindow.FormClosing += (sender, e) => + { + MessageBox.Show("Closing..."); + }; + ViewModelBinder.Bind(new CustomDialogModel { Host = ManagedFormHost }, this, null); } } diff --git a/Source/src/WixSharp.Samples/Wix# Samples/Managed Setup/CustomUI.WPF/CustomWpfDialogRaw.xaml.cs b/Source/src/WixSharp.Samples/Wix# Samples/Managed Setup/CustomUI.WPF/CustomWpfDialogRaw.xaml.cs index cc5813f6..cc88ffcf 100644 --- a/Source/src/WixSharp.Samples/Wix# Samples/Managed Setup/CustomUI.WPF/CustomWpfDialogRaw.xaml.cs +++ b/Source/src/WixSharp.Samples/Wix# Samples/Managed Setup/CustomUI.WPF/CustomWpfDialogRaw.xaml.cs @@ -1,6 +1,7 @@ -using Caliburn.Micro; -using System; +using System; +using System.Windows; using System.Windows.Media.Imaging; +using Caliburn.Micro; using WixSharp; using WixSharp.UI.Forms; using WixSharp.UI.WPF; @@ -20,6 +21,10 @@ public CustomDialogRawView() public void Init() { + this.ManagedFormHost.FormClosing += (sender, e) => + { + MessageBox.Show("Closing1"); + }; Banner.Source = this.ManagedFormHost?.Runtime.Session.GetResourceBitmap("WixUI_Bmp_Banner").ToImageSource(); } diff --git a/Source/src/WixSharp.Samples/Wix# Samples/Managed Setup/CustomUI.WPF/setup.cs b/Source/src/WixSharp.Samples/Wix# Samples/Managed Setup/CustomUI.WPF/setup.cs index 9958d578..932c6254 100644 --- a/Source/src/WixSharp.Samples/Wix# Samples/Managed Setup/CustomUI.WPF/setup.cs +++ b/Source/src/WixSharp.Samples/Wix# Samples/Managed Setup/CustomUI.WPF/setup.cs @@ -16,10 +16,10 @@ static public void Main(string[] args) project.GUID = new Guid("6f330b47-2577-43ad-9095-1861ba25889b"); project.ManagedUI = new ManagedUI(); project.ManagedUI.InstallDialogs.Add() // stock WinForm dialog - .Add() // stock WinForm dialog + .Add() // custom WPF dialog (with Claiburn.Micro as MVVM) .Add>() // custom WPF dialog (minimalistic); + .Add() // stock WinForm dialog .Add() // custom WPF dialog - .Add() // custom WPF dialog (with Claiburn.Micro as MVVM) .Add() // stock WinForm dialog .Add(); // stock WinForm dialog diff --git a/Source/src/WixSharp.Samples/Wix# Samples/Shortcuts/setup.cs b/Source/src/WixSharp.Samples/Wix# Samples/Shortcuts/setup.cs index 68aaef8b..ef3a4e95 100644 --- a/Source/src/WixSharp.Samples/Wix# Samples/Shortcuts/setup.cs +++ b/Source/src/WixSharp.Samples/Wix# Samples/Shortcuts/setup.cs @@ -25,11 +25,18 @@ static public void Main() Target = "https://github.com/oleg-shilo/wixsharp" }, new Dir("Samples", - new File(@"AppFiles\MyApp.cs")), + new File(@"AppFiles\MyApp.cs", + new FileShortcut("MyApp", @"%StartMenuFolder%") + { + IconFile = @"AppFiles\Icon.ico", + WorkingDirectory = "Samples", + Arguments = "777", + Description = "My Application" + })), new File(@"AppFiles\MyApp.exe", new FileShortcut("MyApp", "INSTALLDIR"), //INSTALLDIR is the ID of "%ProgramFiles%\My Company\My Product" - new FileShortcut("MyApp", @"%Desktop%") + new FileShortcut("MyApp", @"%StartMenuFolder%") { IconFile = @"AppFiles\Icon.ico", WorkingDirectory = "Samples", diff --git a/Source/src/WixSharp.UI/ManagedUI/Forms/WelcomeDialog.cs b/Source/src/WixSharp.UI/ManagedUI/Forms/WelcomeDialog.cs index 149f33f6..29e53565 100644 --- a/Source/src/WixSharp.UI/ManagedUI/Forms/WelcomeDialog.cs +++ b/Source/src/WixSharp.UI/ManagedUI/Forms/WelcomeDialog.cs @@ -1,4 +1,6 @@ using System; +using System.Diagnostics; +using System.Windows.Forms; namespace WixSharp.UI.Forms { diff --git a/Source/src/WixSharp/ManagedProject/ManagedProjectActions.cs b/Source/src/WixSharp/ManagedProject/ManagedProjectActions.cs index 884ed2ee..bbe94056 100644 --- a/Source/src/WixSharp/ManagedProject/ManagedProjectActions.cs +++ b/Source/src/WixSharp/ManagedProject/ManagedProjectActions.cs @@ -61,10 +61,11 @@ public static ActionResult WixSharp_Load_Action(Session session) public static ActionResult WixSharp_BeforeInstall_Action(Session session) { // Debugger.Launch(); - session["ADDFEATURES"] = session.Features - .Where(x => x.RequestState != InstallState.Absent) - .Select(x => x.Name) - .JoinBy(","); + if (session.IsActive()) + session["ADDFEATURES"] = session.Features + .Where(x => x.RequestState != InstallState.Absent) + .Select(x => x.Name) + .JoinBy(","); return ManagedProject.InvokeClientHandlers(session, "BeforeInstall"); } diff --git a/Source/src/WixSharp/Properties/AssemblyInfo.version.cs b/Source/src/WixSharp/Properties/AssemblyInfo.version.cs index 8ab9d42b..172cf0e8 100644 --- a/Source/src/WixSharp/Properties/AssemblyInfo.version.cs +++ b/Source/src/WixSharp/Properties/AssemblyInfo.version.cs @@ -7,5 +7,5 @@ // Build Number // Revision // -[assembly: AssemblyVersion("2.1.9.0")] -[assembly: AssemblyFileVersion("2.1.9.0")] \ No newline at end of file +[assembly: AssemblyVersion("2.2.0.0")] +[assembly: AssemblyFileVersion("2.2.0.0")] \ No newline at end of file diff --git a/Source/src/WixSharp/Utilities/AttachedProperies.cs b/Source/src/WixSharp/Utilities/AttachedProperties.cs similarity index 98% rename from Source/src/WixSharp/Utilities/AttachedProperies.cs rename to Source/src/WixSharp/Utilities/AttachedProperties.cs index bd5451b4..c58c6465 100644 --- a/Source/src/WixSharp/Utilities/AttachedProperies.cs +++ b/Source/src/WixSharp/Utilities/AttachedProperties.cs @@ -9,7 +9,7 @@ namespace WixSharp /// This class allows attaching arbitrary data to any object. This behavior resembles /// AttachedProperty in WPF. /// - public static class AttachedProperies + public static class AttachedProperties { /// /// The object cache. Contains object that have values attached. diff --git a/Source/src/WixSharp/WixSharp.csproj b/Source/src/WixSharp/WixSharp.csproj index fb9ac3ff..afa48abf 100644 --- a/Source/src/WixSharp/WixSharp.csproj +++ b/Source/src/WixSharp/WixSharp.csproj @@ -113,7 +113,7 @@ - +