Skip to content

Commit

Permalink
Wix4: #1574: Added errorhandling to continue extecution if WiX extens…
Browse files Browse the repository at this point in the history
…ion is not install. The error will be reported by the WiX compiler
  • Loading branch information
oleg-shilo committed Aug 1, 2024
1 parent c2eba19 commit ba8a576
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Source/src/WixSharp.Samples/Wix# Samples/testpad/setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ static class Script
{
static public void Main()
{
var ttt = WixTools.FindWixExtensionDll("WixToolset.UI.wixext");
return;
Feature poFeature = new Feature("PO", "PO", "INSTALLDIR");

var project = new ManagedProject("My Product",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

<ItemGroup>
<PackageReference Include="WixToolset.Dtf.WindowsInstaller" Version="4.0.2" />
<PackageReference Include="WixToolset.UI.wixext" Version="5.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion Source/src/WixSharp/Utilities/WixTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -324,11 +324,13 @@ static public string FindWixExtensionDll(string name, string version = null)

static string FindWixExtensionDll(string extensionDir, string name, string version)
{
if (!extensionDir.PathCombine(name).PathExists())
return null;

// C:\Users\user\.wix\extensions\WixToolset.UI.wixext\5.0.0\wixext5\WixToolset.UI.wixext.dll
// C:\Users\user\.wix\extensions\WixToolset.UI.wixext\4.0.4\wixext4\WixToolset.UI.wixext.dll
// C:\Users\user\.wix\extensions\WixToolset.Bal.wixext\4.0.2\wixext4\WixToolset.Bal.wixext.dll
// C:\Users\user\.wix\extensions\WixToolset.Bal.wixext\5.0.0\wixext5\WixToolset.BootstrapperApplications.wixext.dll

var candidates = Directory
.GetDirectories(extensionDir.PathCombine(name))
.Select(x => new
Expand Down

0 comments on commit ba8a576

Please sign in to comment.