-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bootstrapper Custom BA (WiX4) problems and current status #1671
Comments
Thank you for reporting it. |
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. |
Can you share with me your update project with the binaries? I want to investigate it. |
Thank you. Here is WiX4 Bootstrapper template project. |
OK, your project is perfectly fine. 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 (0a6c6da) 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 |
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 However, you do not need to uninstall WiX5/4. 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: 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. |
Thank you. I originally ran the console commands to see if they made any difference but it didn't. I did run the following from console command line:
Could this be the cause and is there a way to fix? |
Yes, indeed it can be the cause. In fact, most likely. I did not realize that wix can detect the damaged packages. Great feature. You can try to fix the extension manually. It will be something like |
Thank you. I found much discussion about the (damaged) problem. The discussion seems to indicate that you must be version-specific when requesting an install. I removed all the extensions. Then ran your latest project. However, it had issues and generated the following result:
To clarify, it appeared the Wix3 template ran without issue and requiring extensions, but the Wix4 requires extensions. Is it possible to know the exact Wix utility and extension command lines to install a specific version to avoid this complexity and just run either a Wix3 bootstrap or Wix4 bootstrap as you originally illustrated? |
Sorry about the delay.
It's kinda consistent with your prev description. For some reason deploying WixToolset extensions is problematic on your environment. WixSharp tries to do it on your behalf but it leads to no result. That's why I wanted you manually execute what WixSharp normally does in background if the extension is not found. Thus removing all extensions and rebuilding the project confirmed that it was no accident but a persistent problem. wix extension add -g WixToolset.Bal.wixext Then WixSharp will be able to find them, providing you managed to install them.
If you want to guide WixSharp to use a specific version then you can just place this instruction(s) in your code before compiling the project: WixExtension.UI.PreferredVersion = "4.0.4";
Correct. WiX4 was the one that introduced this new mechanizm |
You can send me the bundle build command and I can check which versions of the required extensions are compatible by testing it in my environment. You can generate the command by calling And I found the installation command for you. It is in fact in an WixSharp codebase: |
Thank you. The original install for Wix defaulted to Wix 5.0.2 tools. If I try to install the v4 extension it fails: So, is that saying I can't run with V4 with a 5.0.2 install because it can't be configured and would have to run as a V5 install because now the Bal extension is required (unlike Wix3)? If I run wix extension add -g WixToolset.Bal.wixext
What am I looking for: "send me the bundle build command"? .wxs file? |
Thank you. I asked over on WixToolset project and received this response that the extension was renamed in Wix5: Document changes here: https://wixtoolset.org/docs/fivefour/oopbas/ I was able to install the extension with new name undamaged. When I run the latest template with WixTools 5, it builds. However, MyProduct.exe, I get a Hello Word message box, then default msi dialog. I do not see the xaml bootstrap dialog. When I run the latest template with WixTools 4, build fails. I get error messages for the older name as damaged. Before running template:
After running new template (set to use WixTools 4,):
The project failed build messages: Wix project file has been built: C:\Users\A User\Documents\Support\WixSharp\1671\WixSharp Setup - Bootstrapper Custom BA (WiX4)1\MyProduct.wxs Compiling MyProduct.wxs 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. Wix project file has been built: C:\Users\A User\Documents\Support\WixSharp\1671\WixSharp Setup - Bootstrapper Custom BA (WiX4)1\setup.wxs 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: I noticed the new template is bound to WixSharp_wix4 package 2.4.2 with transitive packages WisSharp_wix4.bin 2.4.2, WixToolset.Dtf.WindowsInstaller 4.01, and WixToolset.Mba.Core 4.0.1. |
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?
The text was updated successfully, but these errors were encountered: