Skip to content
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

Upgrade to using WiX 4 #1185

Open
freakboy3742 opened this issue Apr 15, 2023 · 6 comments
Open

Upgrade to using WiX 4 #1185

freakboy3742 opened this issue Apr 15, 2023 · 6 comments
Labels
enhancement New features, or improvements to existing features. windows The issue relates to Microsoft Windows support.

Comments

@freakboy3742
Copy link
Member

What is the problem or limitation you are having?

Windows packaging currently uses WiX Toolset 3. This version of WiX has a known issue with long file paths (#948), as well as no support for ARM64.

Describe the solution you'd like

Briefcase should be updated to use WiX 4.

Describe alternatives you've considered

Stay on WiX 3.

Additional context

WiX 4 release details.

It is unclear how much the format for WiX configuration files has changed - this could be as straightforward as changing the path to the WiX binary that is downloaded.

@freakboy3742 freakboy3742 added enhancement New features, or improvements to existing features. windows The issue relates to Microsoft Windows support. labels Apr 15, 2023
@rmartin16
Copy link
Member

rmartin16 commented Apr 16, 2023

Figured this would be an easy win....but it's a bit more involved. Here are some notes I made.

WiX 4

  • Requires .NET SDK version 6 or later is installed
    • Pretty easy to check with dotnet --list-sdks
  • WiX 4 is now a .NET Tool
  • Install methods
    • Global install
      • dotnet tool install --global wix --version 4.0.0
      • This installs the tool to %USERPROFILE%\.dotnet\tools and is available via $PATH
      • Since NuGET is involved, the tool is really installed to %USERPROFILE%\.nuget\packages\wix\4.0.0
      • This means if a user (or another app) runs dotnet tool install --global wix --version 4.1.0, Briefcase would start using WiX 4.1.0
      • There's also a --tool-path version of --global that allows a custom install location but otherwise the same semantics
    • Local install
      • dotnet tool install --local wix --version 4.0.0
        • I think this requires calling dotnet new tool-manifest first for the directory
      • Really, the tool is installed normally to the dot directories...it just isn't added to $PATH or anything
      • As long as you're in the same directory as the dotnet tool install command, you can run this install with dotnot tool run wix (or dotnet wix)
  • Install considerations
    • To maintain some level of isolation from the user's environment, the "local install" seems desirable
    • So, I think that would mean WiX 4 could be installed in to Briefcase's AppData directory and all uses of subprocess for WiX would require cwd set appropriately
    • Alternatively, we could just run the dotnet tool install command in the base directory of the app...however, that'll likely complicate the story for briefcase upgrade wix
  • Template changes
    • WiX 4 provides a wix convert command to update wxs files
    • This'll presumably be necessary for both the app and VisualStudio templates
  • WiX usage changes
    • The executables for light, candle, and heat do not exist anymore
    • It seems they have been made sub-commands of the primary wix executable

So, it seems this affects pretty much anything that could've been affected 🙃 I also think this means supporting both version 3 and 4 of WiX concurrently would be prohibitive....not that we'd necessarily want to...

@freakboy3742
Copy link
Member Author

Thanks for that audit - a list of annoying changes, to be sure; but nothing that sounds like an unsurmountable challenge.

In terms of supporting both - unless there's a feature of WiX 3 that WiX 4 doesn't (or won't) support, I don't think we need to support both. WiX 3 has at least 2 major missing features (>64 char path name support, and ARM64 support); so IMHO we should migrate as soon as practical.

@rmartin16
Copy link
Member

rmartin16 commented Jun 4, 2023

I made an attempt at this upgrade....but I think the gap in my knowledge about where and how WiX is expecting to fit in to a larger Windows development and packaging workflow is too large.

I converted the WiX files provided by the app template in beeware/briefcase-windows-app-template#14; there are likely some necessary tweaks and optimizations but that should be most of the work.

When I focused my attention on updating the calls to heat.exe, candle.exe, and light.exe, I basically hit a brick wall despite spending hours trying to understand the larger picture. The WiX 4 docs for heat say to "add a reference to the new heat nuget package"....but where exactly? Presumably in to some larger project configuration files. Maybe an MSBuild config? It seems like much more of an assumed project structure is necessary that was not needed for WiX 3.

At any rate, I thought I could power through and figure it out relatively quickly....but I don't think so. I may return to this later if someone else doesn't knock it out.

@freakboy3742
Copy link
Member Author

Good to know WiX is maintaining its long tradition of near useless documentation... 🙄

@rmartin16
Copy link
Member

FYI; looks like WiX is moving to an annual release schedule.

https://www.firegiant.com/blog/2024/3/8/wix-v5.0.0-rc.1-is-calling/

@freakboy3742
Copy link
Member Author

Ugh... we really do need to address this so we don't get stuck on v3 forever...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New features, or improvements to existing features. windows The issue relates to Microsoft Windows support.
Projects
None yet
Development

No branches or pull requests

2 participants