Skip to content

Update to WiX 5#2355

Merged
mhsmith merged 8 commits intobeeware:mainfrom
mhsmith:wix4
Jul 9, 2025
Merged

Update to WiX 5#2355
mhsmith merged 8 commits intobeeware:mainfrom
mhsmith:wix4

Conversation

@mhsmith
Copy link
Member

@mhsmith mhsmith commented Jun 25, 2025

Corresponding template PRs:

Main changes:

  • WiX is now always used as a Briefcase-managed tool, and is automatically upgraded.
  • The WiX build process has been greatly simplified, from 3 commands down to 1.
  • The functionality of heat.exe has been replaced by a <Files> element in the template. The "external app" mode therefore now only affects briefcase create, not briefcase package.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

assert mock_tools.file.download.call_count == 0


def test_existing_wix_install(mock_tools, tmp_path):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've removed the remaining tests in this file because they were redundant:

  • The fact that upgrade calls install followed by unininstall is covered by tests/command/upgrade.
  • The functionality of WiX's install and uninstall is covered by their own tests.


``[tool.briefcase.app.<app name>.<platform>.document_type.<document type id>]``

The ``document type id`` is an identifier, in alphanumeric format. It is appended to the app id of an application to identify documents of the same type.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed internal implementation detail which is meaningless to the Briefcase user.

Comment on lines -623 to -625
The :attr:`extension` is the file extension to register. For example, ``myapp``
could register as a handler for PNG image files by defining the configuration
section ``[tool.briefcase.app.myapp.document_type.png]``.
Copy link
Member Author

@mhsmith mhsmith Jul 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implied that the section ID and the extension must be the same, or that the extension attribute is optional, neither of which are true.

@mhsmith mhsmith marked this pull request as ready for review July 5, 2025 02:11
@mhsmith mhsmith requested a review from freakboy3742 July 5, 2025 02:24
Comment on lines 98 to +101
install_scope = "perMachine" if app.system_installer else "perUser"
except AttributeError:
# system_installer not defined in config; default to asking the user
install_scope = None
install_scope = "perUserOrMachine"
Copy link
Member Author

@mhsmith mhsmith Jul 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perUser, perMachine and perUserOrMachine are the 3 available scope keywords in the current version of WiX, and I had originally hoped to use them directly in the template. That ended up being more complicated for reasons that are explained in the template PR, but I've continued using the keywords in the Briefcase/template interface because it's a clear way of expressing Briefcase's intention.

Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good to me. Most of the complexity is in the templates; this is mostly a simplification of the downloading and invocation process - both of which are dramatically simplified because of the changes in WiX 5.

extract_dir=os.fsdecode(self.wix_home),
self.tools.subprocess.run(
[
"msiexec",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we certain we can rely on msiexec existing? And that it can be executed as a non-privileged user?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed on my daughter's school-provided (and thus locked-down) windows device - msiexec is available, and can be executed by non-admin users.

@freakboy3742
Copy link
Member

One detail that occurred to me just after approving and kicking off the final build: WiX 3 required the user to provide an install .NET framework 3.5, which wasn't installed by default, so our docs include a mention of this.

WiX now documents that all you need is "a text editor and the .NET SDK"... do we need to retain the .NET instructions? At the very least, we should update to point at a more recent SDK... but I think every win10 machine can guarantee the availability of .NET? Or am I mistaken?

@mhsmith
Copy link
Member Author

mhsmith commented Jul 9, 2025

You're right, it looks like our current version of WiX requires .NET Framework 4.7 or later, and every supported version of Windows comes with 4.8 pre-installed. So I've just removed that section of the instructions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade to a current WiX version

2 participants