Skip to content

Commit

Permalink
Wix4: Release v2.2.0
Browse files Browse the repository at this point in the history
- The whole round trip implementation for the elevated events (#1565, #1567). Not integrated to the API yet
- added `restart elevated` routine for custom BA sample
- Issue #1554: Add custom Wizard-like Installer to Bundle / Burn Installer
- Implemented `MsiExePackage`. Triggered by #1554
  Dedicates 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
- WiX4: added `WixProject.WixBuildCommandGenerated` even. 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
  • Loading branch information
oleg-shilo committed Jun 29, 2024
1 parent 59ebb9f commit c9ec41d
Show file tree
Hide file tree
Showing 13 changed files with 74 additions and 31 deletions.
14 changes: 11 additions & 3 deletions Source/src/NET-Core/WixSharp.Core/WixSharp.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<FileVersion>2.1.4</FileVersion>
<AssemblyVersion>2.1.5</AssemblyVersion>
<FileVersion>2.2.0</FileVersion>
<AssemblyVersion>2.2.0</AssemblyVersion>
</PropertyGroup>

<PropertyGroup>
<PackageVersion>2.1.9</PackageVersion>
<PackageVersion>2.2.0</PackageVersion>
<Title>WixSharp (.NET Core)</Title>
<Description>.NET Core edition of WixSharp package</Description>
<Copyright>Oleg Shilo</Copyright>
Expand Down Expand Up @@ -200,6 +200,14 @@
<Compile Include="..\..\WixSharp\WixProject.cs" Link="WixProject.cs" />
<Compile Include="..\..\WixSharp\WixQuietExec.cs" Link="WixQuietExec.cs" />
<Compile Include="..\..\WixSharp\XmlFile.cs" Link="XmlFile.cs" />

<Compile Include="..\..\WixSharp\Utilities\Utils.cs" Link="Utils.cs" />
<Compile Include="..\..\WixSharp\Utilities\XmlMapping.cs" Link="XmlMapping.cs" />
<Compile Include="..\..\WixSharp\Utilities\XmlAttribute.cs" Link="XmlAttribute.cs" />
<Compile Include="..\..\WixSharp\Utilities\ProjectLocalization.cs" Link="ProjectLocalization.cs" />
<Compile Include="..\..\WixSharp\Utilities\SerializingExtensions.cs" Link="SerializingExtensions.cs" />
<Compile Include="..\..\WixSharp\Utilities\AttachedProperties.cs" Link="AttachedProperties.cs" />

</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</PropertyGroup>

<PropertyGroup>
<PackageVersion>2.1.9</PackageVersion>
<PackageVersion>2.2.0</PackageVersion>
<Title>WixSharp (.NET Core)</Title>
<Description>.NET Core edition of WixSharp.Msi package</Description>
<Copyright>Oleg Shilo</Copyright>
Expand Down
13 changes: 8 additions & 5 deletions Source/src/WixSharp.Samples/Wix# Samples/Install Files/setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
})),
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
using WixSharp;
using WixSharp.CommonTasks;
using WixSharp.UI;
using WixToolset.Dtf.WindowsInstaller;

static class Script
{
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<WixSharp.UI.Forms.WelcomeDialog>() // stock WinForm dialog
.Add<FeaturesDialog>() // stock WinForm dialog
.Add<CustomDialogView>() // custom WPF dialog (with Claiburn.Micro as MVVM)
.Add<CustomDialogWith<CustomDialogPanel>>() // custom WPF dialog (minimalistic);
.Add<FeaturesDialog>() // stock WinForm dialog
.Add<CustomDialogRawView>() // custom WPF dialog
.Add<CustomDialogView>() // custom WPF dialog (with Claiburn.Micro as MVVM)
.Add<WixSharp.UI.Forms.ProgressDialog>() // stock WinForm dialog
.Add<WixSharp.UI.Forms.ExitDialog>(); // stock WinForm dialog

Expand Down
11 changes: 9 additions & 2 deletions Source/src/WixSharp.Samples/Wix# Samples/Shortcuts/setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions Source/src/WixSharp.UI/ManagedUI/Forms/WelcomeDialog.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using System;
using System.Diagnostics;
using System.Windows.Forms;

namespace WixSharp.UI.Forms
{
Expand Down
9 changes: 5 additions & 4 deletions Source/src/WixSharp/ManagedProject/ManagedProjectActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
4 changes: 2 additions & 2 deletions Source/src/WixSharp/Properties/AssemblyInfo.version.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.1.9.0")]
[assembly: AssemblyFileVersion("2.1.9.0")]
[assembly: AssemblyVersion("2.2.0.0")]
[assembly: AssemblyFileVersion("2.2.0.0")]
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace WixSharp
/// This class allows attaching arbitrary data to any object. This behavior resembles
/// AttachedProperty in WPF.
/// </summary>
public static class AttachedProperies
public static class AttachedProperties
{
/// <summary>
/// The object cache. Contains object that have values attached.
Expand Down
2 changes: 1 addition & 1 deletion Source/src/WixSharp/WixSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
<Compile Include="Assembly.cs" />
<Compile Include="Utilities\Utils.cs" />
<Compile Include="Utilities\SerializingExtensions.cs" />
<Compile Include="Utilities\AttachedProperies.cs" />
<Compile Include="Utilities\AttachedProperties.cs" />
<Compile Include="AutoElements.cs" />
<Compile Include="BalCondition.cs" />
<Compile Include="Bootstrapper\UtilFileSearch.cs" />
Expand Down

0 comments on commit c9ec41d

Please sign in to comment.