Compare commits

..

19 commits

Author SHA1 Message Date
jkarasti
fc529860de
Merge da09566a3c into 96aa56a6dc 2024-11-11 17:13:24 +00:00
jkarasti
da09566a3c Fixup: Tweak wix install doc 2024-11-11 19:10:16 +02:00
jkarasti
180b907cff Fix: Dangerzone installed using an msi built with WiX Toolset v3 is not uninstalled by an msi built with WiX Toolset v5
Fix the issue by adding some extra functionality to the "Next" button on the welcome screen of the installer. When the user clicks it to proceed with the installation this:
1. Flips the install scope to "perUser" which is the default in WiX v3
2. Finds the older installation
3. And finally flips the scope back to "perMachine" which is the default in WiX v4 and newer

TODO: Revert this once we are reasonably certain there are no affected Dangerzone Installations?
2024-11-11 19:10:16 +02:00
jkarasti
a900a7c42e Change: Wrap installer ui related things in a UI element 2024-11-11 19:10:16 +02:00
JKarasti
945f1846d1 Change: Build a 64-bit installer 2024-11-11 19:08:29 +02:00
JKarasti
3eaa89fcce Docs: Documentation for WiX Toolset 5 2024-11-11 19:08:29 +02:00
JKarasti
63dbe6a037 Change: Update the build-app.bat script to work with WiX Toolset v5
- WiX Toolset v3 used to validate the msi package by default. In v5 that has moved to a new command, so add a new validation step to the script.

- Also emove the step that uses `insignia.exe` to sign the Dangerzone.msi with the digital signatures from its external cab archives.

  In WiX Toolset v4 and newer, insignia is replaced with a new command `wix msi inscribe`, but we tell wix to embed the cabinets into the .msi
  (That's what`EmbedCab="yes"` in the Media / MediaTemplate element does) so singning them separately is not necessary. [0]

  [0] https://wixtoolset.org/docs/tools/signing/
2024-11-11 19:08:29 +02:00
JKarasti
0767e01053 CI: Use WiX Toolset v5 to build the msi 2024-11-11 19:08:29 +02:00
JKarasti
ada9f47d65 Change: Write Dangerzone.wxs inside the script directly
Also reduce duplication slightly by definig `build_dir`, `cx_freeze_dir` and `dist_dir`
2024-11-11 19:08:29 +02:00
JKarasti
39062804bf Fix: Make GUIDs uppercase
See [1]

[1] https://learn.microsoft.com/en-us/windows/win32/msi/guid
2024-11-11 19:08:29 +02:00
JKarasti
9da607093f Change: Write dangerzone version and upgradecode into Package and SummaryInformation elements directly 2024-11-11 19:08:29 +02:00
JKarasti
02c8396a9a Refactor: build_dir_xml() function
- rename for clarity
- remove unnecessary checks
2024-11-11 19:08:29 +02:00
JKarasti
2b73427e16 Change: Wrap all files to be included in the .msi in a ComponentGroupRef
With this, all the files are organised into Components,
each of which points to a Directory defined in the StandardDirectory element.
This simplifies the Feature element considerable as only thing it needs to
include everything in the built msi is a reference to `ApplicationComponents`
2024-11-11 19:08:29 +02:00
JKarasti
c7e3f995c0 Refactor: Simplify build_data() function
- Rename variables to be more clear about what they do:
- reorganise code
- simplify a few checks
2024-11-11 19:08:29 +02:00
JKarasti
410beead11 Change: Swap Media element with MediaTemplate
This is a new default and makes authoring slightly simpler without any functional changes.
2024-11-11 19:08:29 +02:00
JKarasti
68cd96a7d3 Change: Convert Wix UI extension authoring to WiX Toolset v5
Due to limitations of the xml.etree.ElementTree library, add the items in the root element as a dictionary
2024-11-11 19:08:29 +02:00
JKarasti
e6f5a25818 Change: Wrap ProgramFilesFolder component with a StandardDirectory component 2024-11-11 19:08:29 +02:00
JKarasti
28b555ac6f Change: Wrap ProgramMenuFolder component with a StandardDirectory component 2024-11-11 19:08:29 +02:00
jkarasti
9a87e64e69 Change: Disable AllowSameVersionUpgrades
Since running `wix msi validate` with it set to `yes` causes an error.
2024-11-11 19:08:29 +02:00
3 changed files with 8 additions and 8 deletions

View file

@ -115,9 +115,9 @@ jobs:
with:
dotnet-version: "8.x"
- name: Install WiX Toolset
run: dotnet tool install --global wix --version 5.0.1
run: dotnet tool install --global wix
- name: Add WiX UI extension
run: wix extension add --global WixToolset.UI.wixext/5.0.1
run: wix extension add --global WixToolset.UI.wixext
- name: Build the MSI installer
# NOTE: This also builds the .exe internally.
run: poetry run .\install\windows\build-app.bat

View file

@ -476,20 +476,21 @@ poetry shell
### If you want to build the Windows installer
Install [.NET SDK](https://dotnet.microsoft.com/en-us/download) version 6 or later. Then, open a terminal and install the [WiX Toolset .NET tool](https://wixtoolset.org/) v5.0.1.
Install [.NET SDK](https://dotnet.microsoft.com/en-us/download) version 6 or later. Then, open a terminal and install the latest version of [WiX Toolset .NET tool](https://wixtoolset.org/) **v5** with:
```sh
dotnet tool install --global wix --version 5.0.1
dotnet tool install --global wix --version 5.*
```
Install the WiX UI extension **in a new terminal**, in order to use the newly installed `wix` .NET tool:
Install the WiX UI extension. You may need to open a new terminal in order to use the newly installed `wix` .NET tool:
```sh
wix extension add --global WixToolset.UI.wixext/5.0.1
wix extension add --global WixToolset.UI.wixext/5.x.y
```
> [!IMPORTANT]
> To prevent compatibility issues, ensure that all WiX plugins you install match the version of WiX Toolset.
> To avoid compatibility issues, ensure the WiX UI extension version matches the version of the WiX Toolset.
> Run `wix --version` to check the version of WiX Toolset you have installed and replace `5.x.y` with the full version number without the Git revision.
### If you want to sign binaries with Authenticode

View file

@ -167,7 +167,6 @@ def main():
ET.SubElement(
package_el,
"MajorUpgrade",
AllowSameVersionUpgrades="yes",
DowngradeErrorMessage="A newer version of [ProductName] is already installed. If you are sure you want to downgrade, remove the existing installation via Programs and Features.",
)