Open frnds1 opened 1 week ago
Thank you for reporting it. Will have a look asap.
I just tested it.
The only problem I had was that the project target runtime version was lower than the WixSharp nuget package has. I updated it manually and after that project builts fine and XAML designer is displayed OK too:
Note there is a strange XLS error on loading the designer but it seems to have no impact on anything. designer works correctly, bundle builds and runs fine.
I will update the template. But in a meantime, you can use the attached project as a template. WixSharp Setup - Bootstrapper Custom BA (WiX4)1.zip
Thank you. I hit the 4.6.2 issue on the first build and switched to 4.7.2. I get the same results with your zip file--same warnings and errors. When I run the MyProduct.exe I get the same license dialog instead of the XAML dialog:
Can you share with me your update project with the binaries? I want to investigate it.
Thank you. Here is WiX4 Bootstrapper template project. WixSharp Setup - Bootstrapper Custom BA (WiX4)1.zip
OK, your project is perfectly fine. It's probably the tools that you are using that are doing the damage.
The problem is that the template you are using was designed for the WiX4 tools. However, I suspect that on your environment you have WiX5 tools installed.
Thus in order to fix it it was enough to just put this line in the build script:
WixTools.SetWixVersion(Environment.CurrentDirectory, "4.0.0");
This is required as WiX5 Custom BA hosting has dramatically changed, so you need to downgrade the BA hosting model. Previously, Custom BA was just an assembly (DLL) with the entry point being specially marked with the WiX attribute. In WiX5 the BA is a standalone executable that does not use any attributes and simply communicates with the WiX runtime via IPC.
Though WixSharp already comes with the example of hosting custom BA for WiX5, that example has not yet been released as a template. That's why I recommend that you downgrade your tools.
Anyway, just to show you how one can build a custom BA for WiX4 and WiX5 I have updated your sample (attached). Now it contains
I have updated (0a6c6da1389f2345a462c5a07f1efc042dd0cf18) the template WiX4 to set the tools to the WiX4 version and ensure the compatible Custom BA hosting model.
Thank you. I checked. On this system, on Wix 5 was installed because that was the current that defaulted. I did a build on your new project and have several errors. I installed Wix 4, but that didn't help. I tried installing the extensions manually per the error messages, but that did not improve things. I was able to build and run the WixBA.5 project. How do I uninstall Wix 5 and ensure I have the correct version of 4 for your template?
Here are the errors:
1>Compiling MyProduct.wxs
1>Source base directory: C:\Users\Chant Development\Documents\Support\WixSharp\1671\WixSharp Setup - Bootstrapper Custom BA (WiX4)1
1>EXEC : error : Cannot find WiX extension 'WixToolset.UI.wixext'. WixSharp attempted to install the extension but did not succeed. Please install the extension manually with: wix.exe extension add -g WixToolset.UI.wixext
1>wix.exe : error WIX0144: The extension 'C:\Users\Chant Development\Documents\Support\WixSharp\1671\WixSharp Setup - Bootstrapper Custom BA (WiX4)1\MyProduct.wxs' could not be loaded because of the following reason: Could not load file or assembly 'C:\Users\Chant Development\Documents\Support\WixSharp\1671\WixSharp Setup - Bootstrapper Custom BA (WiX4)1\MyProduct.wxs'. Format of the executable (.exe) or library (.dll) is invalid.
1>C:\Users\Chant Development\Documents\Support\WixSharp\1671\WixSharp Setup - Bootstrapper Custom BA (WiX4)1
1>
1>EXEC : warning : DisplayInternalUI value of MsiPackages will be ignored because you are using custom BA. For custom BA applications visibility of the individual MSI packages needs to be controlled from the PlanMsiPackage event handler of the BA.
1>Read more here: https://github.com/oleg-shilo/wixsharp/issues/1396#issuecomment-1849731522
1>
1>
1>----------------------------------------------------------
1>
1>Wix project file has been built: C:\Users\Chant Development\Documents\Support\WixSharp\1671\WixSharp Setup - Bootstrapper Custom BA (WiX4)1\setup.wxs
1>
1>EXEC : error : Cannot find WiX extension 'WixToolset.Netfx.wixext'. WixSharp attempted to install the extension but did not succeed. Please install the extension manually with: wix.exe extension add -g WixToolset.Netfx.wixext
1>EXEC : error : Cannot find WiX extension 'WixToolset.Bal.wixext'. WixSharp attempted to install the extension but did not succeed. Please install the extension manually with: wix.exe extension add -g WixToolset.Bal.wixext
1>Cannot build C:\Users\Chant Development\Documents\Support\WixSharp\1671\WixSharp Setup - Bootstrapper Custom BA (WiX4)1\setup.wxs
1>C:\Users\Chant Development\Documents\Support\WixSharp\1671\WixSharp Setup - Bootstrapper Custom BA (WiX4)1\WixSharp Setup - Bootstrapper Custom BA (WiX4)1.csproj(33,5): error MSB3073: The command "cd .\
1>C:\Users\Chant Development\Documents\Support\WixSharp\1671\WixSharp Setup - Bootstrapper Custom BA (WiX4)1\WixSharp Setup - Bootstrapper Custom BA (WiX4)1.csproj(33,5): error MSB3073: set ide=true
1>C:\Users\Chant Development\Documents\Support\WixSharp\1671\WixSharp Setup - Bootstrapper Custom BA (WiX4)1\WixSharp Setup - Bootstrapper Custom BA (WiX4)1.csproj(33,5): error MSB3073: "C:\Users\Chant Development\Documents\Support\WixSharp\1671\WixSharp Setup - Bootstrapper Custom BA (WiX4)1\bin\Release\net472\WixSharp Setup - Bootstrapper Custom BA (WiX4)1.exe"" exited with code -1.
1>Done building project "WixSharp Setup - Bootstrapper Custom BA (WiX4)1.csproj" -- FAILED.
How do I uninstall Wix 5...
WiX4+ is distributed as a .NET Tool it's a .NET native application packaging mechanism. So you you want to remove a tool then you need to find the required command with dotnet tool -?
However, you do not need to uninstall WiX5/4.
The project I shared with you shows how to tell your WixSharp compilation which of the installed WiX versions should be used for the MSI build: WixTools.SetWixVersion(Environment.CurrentDirectory, "4.0.0");
The last argument is the version of the installed WiX tool that you want to use.
Now, about the problem you are experiencing. You probably noticed that the error message explained to you the cause of the error - the absence of the WiX extension package on your system. It even gave you a suggestion on how to install the package manually: wix.exe extension add -g...
. Thus if execute these two commands it suggested you will be able to install the missing extensions. Probably, it's better to use the latest version of your wix.exe for installing the package.
The interesting bit is that WixSharp proactively tries to install the extension:
I think the package installation has failed for some reason so WixSharp suggests you do it manually. If you do that then you may even see if indeed the extension package installation fails and why.
Building the current template for Bootstrapper Custom BA (WiX4) in VS 2022 17.11.5 yields several problems instead of displaying the XAML dialog like the WiX3 template.
Removing the DisplayInternalUI setting and adding the PlansMsiPackage settings, eliminates the warnings and references to the discussion. However, there is still a build warning:
Custom BA payloads are missing 'WinToolset.BootstrapperApplicationAPI.dll'
After running there are two errors: WIX0103: Cannot find the File file 'Program.cs'. Tje following paths were checked: Program.cs WIX0407: There is no payload define for package 'MyProductPackageId'. This is specified on the MsiPackage element or child MsiPackagePayload element.
Cannot build ... setup.wxs Exit code 0.
Running the MyProduct.exe generated displays the Prerequisite required for MyProduct setup dialog.
Are there adjustments to the WiX4 template to eliminate these errors and yield the XAML dialog display like the WiX3 template?