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

Windows Installer: Upgrade to WiX Toolset 5 #929

Merged
merged 23 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3bcf5fc
Fix: SyntaxWarning while generating Dangerzone.wxs
jkarasti Sep 12, 2024
8e57d81
Fix: Make generated WiX authoring pass WixCop checks
jkarasti Sep 23, 2024
adddb1e
Change: Stop generating an XML declaration at the top of the WiX auth…
jkarasti Sep 23, 2024
f349e16
Change: Update WiX schema namespace
jkarasti Sep 23, 2024
180b944
Change: Rename `INSTALLDIR` to `INSTALLFOLDER`
jkarasti Sep 23, 2024
cc5ba29
Change: Merge Product into Package element
jkarasti Sep 23, 2024
68da50a
Change: Disable `AllowSameVersionUpgrades`
jkarasti Nov 11, 2024
4638444
Change: Wrap `ProgramMenuFolder` component with a `StandardDirectory`…
jkarasti Sep 23, 2024
abb71e0
Change: Wrap `ProgramFilesFolder` component with a `StandardDirectory…
jkarasti Sep 23, 2024
4eadc30
Change: Convert Wix UI extension authoring to WiX Toolset v5
jkarasti Sep 23, 2024
ccb3024
Change: Swap Media element with MediaTemplate
jkarasti Sep 23, 2024
265c1dd
Refactor: Simplify `build_data()` function
jkarasti Sep 23, 2024
41e78c9
Change: Wrap all files to be included in the .msi in a `ComponentGrou…
jkarasti Sep 23, 2024
8bd9c05
Refactor: `build_dir_xml()` function
jkarasti Sep 23, 2024
3fff16c
Change: Write dangerzone version and upgradecode into Package and Sum…
jkarasti Sep 23, 2024
3db1ca1
Fix: Make GUIDs uppercase
jkarasti Sep 23, 2024
2053c98
Change: Write Dangerzone.wxs inside the script directly
jkarasti Sep 23, 2024
38a8030
CI: Use WiX Toolset v5 to build the msi
jkarasti Sep 23, 2024
a915ae8
Change: Update the `build-app.bat` script to work with WiX Toolset v5
jkarasti Sep 23, 2024
3264160
Docs: Update documentation for WiX Toolset 5
jkarasti Sep 23, 2024
f537d54
Change: Build a 64-bit installer
jkarasti Sep 23, 2024
4b5f4b2
Fix: Dangerzone installed using an msi built with WiX Toolset v3 is …
jkarasti Nov 20, 2024
1c0a99f
Update changelog
apyrgio Dec 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,14 @@ jobs:
key: v1-tessdata-${{ hashFiles('./install/common/download-tessdata.py') }}
- name: Run CLI tests
run: poetry run make test
# Taken from: https://github.com/orgs/community/discussions/27149#discussioncomment-3254829
- name: Set path for candle and light
run: echo "C:\Program Files (x86)\WiX Toolset v3.14\bin" >> $GITHUB_PATH
shell: bash
- name: Set up .NET CLI environment
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.x"
- name: Install WiX Toolset
run: dotnet tool install --global wix
- name: Add WiX UI extension
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
Expand Down
21 changes: 17 additions & 4 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -471,11 +471,24 @@ poetry shell
.\dev_scripts\dangerzone.bat
```

### If you want to build the installer
### If you want to build the Windows installer

* Go to https://dotnet.microsoft.com/download/dotnet-framework and download and install .NET Framework 3.5 SP1 Runtime. I downloaded `dotnetfx35.exe`.
* Go to https://wixtoolset.org/releases/ and download and install WiX toolset. I downloaded `wix314.exe`.
* Add `C:\Program Files (x86)\WiX Toolset v3.14\bin` to the path ([instructions](https://web.archive.org/web/20230221104142/https://windowsloop.com/how-to-add-to-windows-path/)).
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.*
```

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.x.y
```

> [!IMPORTANT]
> 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

Expand Down
13 changes: 7 additions & 6 deletions install/windows/build-app.bat
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,23 @@ signtool.exe sign /v /d "Dangerzone" /a /n "Freedom of the Press Foundation" /fd
REM verify the signature of dangerzone-cli.exe
signtool.exe verify /pa build\exe.win-amd64-3.12\dangerzone-cli.exe

REM build the wix file
python install\windows\build-wxs.py > build\Dangerzone.wxs
REM build the wxs file
python install\windows\build-wxs.py

REM build the msi package
cd build
candle.exe Dangerzone.wxs
light.exe -ext WixUIExtension Dangerzone.wixobj
wix build -arch x64 -ext WixToolset.UI.wixext .\Dangerzone.wxs -out Dangerzone.msi

REM validate Dangerzone.msi
wix msi validate Dangerzone.msi

REM code sign Dangerzone.msi
insignia.exe -im Dangerzone.msi
signtool.exe sign /v /d "Dangerzone" /a /n "Freedom of the Press Foundation" /fd sha256 /t http://time.certum.pl/ Dangerzone.msi

REM verify the signature of Dangerzone.msi
signtool.exe verify /pa Dangerzone.msi

REM moving Dangerzone.msi to dist
REM move Dangerzone.msi to dist
cd ..
mkdir dist
move build\Dangerzone.msi dist
Loading
Loading