Skip to content

Commit df2998c

Browse files
authored
NSIS: add support for Windows ARM64 build
Qt >=6.8 can native compile on Windows ARM64 machine, and GitHub also provides windows-11-arm runner. so I think It's time to add support. I've tested from my branch and Snapdragon 8cx gen3 computer. all ci build passed. Closes #11465 PR #23328.
1 parent d671632 commit df2998c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+282
-17
lines changed

.github/workflows/ci_windows.yaml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,19 @@ concurrency:
1010

1111
jobs:
1212
ci:
13-
name: Build
14-
runs-on: windows-latest
13+
name: Build (${{ matrix.libt_version }}, ${{ matrix.config.arch }})
14+
runs-on: ${{ matrix.config.os }}
1515
permissions:
1616
actions: write
1717

1818
strategy:
1919
fail-fast: false
2020
matrix:
2121
libt_version: ["2.0.11", "1.2.20"]
22+
config:
23+
- os: windows-latest
24+
arch: x64
25+
qt_arch: win64_msvc2022_64
2226

2327
env:
2428
boost_path: "${{ github.workspace }}/../boost"
@@ -33,6 +37,8 @@ jobs:
3337

3438
- name: Setup devcmd
3539
uses: ilammy/msvc-dev-cmd@v1
40+
with:
41+
arch: ${{ matrix.config.arch }}
3642

3743
- name: Install build tools
3844
run: |
@@ -57,19 +63,19 @@ jobs:
5763
New-Item `
5864
-Force `
5965
-ItemType File `
60-
-Path "${{ env.vcpkg_path }}/triplets_overlay/x64-windows-static-md-release.cmake"
66+
-Path "${{ env.vcpkg_path }}/triplets_overlay/${{ matrix.config.arch }}-windows-static-md-release.cmake"
6167
# OpenSSL isn't compatible with `/guard:cf` flag so we omit it for now, see: https://github.com/openssl/openssl/issues/22554
6268
Add-Content `
63-
-Path "${{ env.vcpkg_path }}/triplets_overlay/x64-windows-static-md-release.cmake" `
64-
-Value @("set(VCPKG_TARGET_ARCHITECTURE x64)",
69+
-Path "${{ env.vcpkg_path }}/triplets_overlay/${{ matrix.config.arch }}-windows-static-md-release.cmake" `
70+
-Value @("set(VCPKG_TARGET_ARCHITECTURE ${{ matrix.config.arch }})",
6571
"set(VCPKG_LIBRARY_LINKAGE static)",
6672
"set(VCPKG_CRT_LINKAGE dynamic)",
6773
"set(VCPKG_BUILD_TYPE release)")
6874
# clear buildtrees after each package installation to reduce disk space requirements
6975
$packages = `
70-
"boost-build:x64-windows-static-md-release",
71-
"openssl:x64-windows-static-md-release",
72-
"zlib:x64-windows-static-md-release"
76+
"boost-build:${{ matrix.config.arch }}-windows-static-md-release",
77+
"openssl:${{ matrix.config.arch }}-windows-static-md-release",
78+
"zlib:${{ matrix.config.arch }}-windows-static-md-release"
7379
${{ env.vcpkg_path }}/vcpkg.exe upgrade `
7480
--no-dry-run `
7581
--overlay-triplets="${{ env.vcpkg_path }}/triplets_overlay"
@@ -97,7 +103,7 @@ jobs:
97103
move "${{ github.workspace }}/../boost_*" "${{ env.boost_path }}"
98104
cd "${{ env.boost_path }}"
99105
#.\bootstrap.bat
100-
${{ env.vcpkg_path }}/installed/x64-windows-static-md-release/tools/boost-build/b2.exe `
106+
${{ env.vcpkg_path }}/installed/${{ matrix.config.arch }}-windows-static-md-release/tools/boost-build/b2.exe `
101107
stage `
102108
toolset=msvc `
103109
--stagedir=.\ `
@@ -107,7 +113,7 @@ jobs:
107113
uses: jurplel/install-qt-action@v4
108114
with:
109115
version: "6.9.1"
110-
arch: win64_msvc2022_64
116+
arch: ${{ matrix.config.qt_arch }}
111117
archives: qtbase qtsvg qttools
112118
cache: true
113119

@@ -134,7 +140,7 @@ jobs:
134140
-DBUILD_SHARED_LIBS=OFF `
135141
-Ddeprecated-functions=OFF `
136142
-Dstatic_runtime=OFF `
137-
-DVCPKG_TARGET_TRIPLET=x64-windows-static-md-release
143+
-DVCPKG_TARGET_TRIPLET=${{ matrix.config.arch }}-windows-static-md-release
138144
cmake --build build
139145
cmake --install build
140146
@@ -151,7 +157,7 @@ jobs:
151157
-DLibtorrentRasterbar_DIR="${{ env.libtorrent_path }}/install/lib/cmake/LibtorrentRasterbar" `
152158
-DMSVC_RUNTIME_DYNAMIC=ON `
153159
-DTESTING=ON `
154-
-DVCPKG_TARGET_TRIPLET=x64-windows-static-md-release `
160+
-DVCPKG_TARGET_TRIPLET=${{ matrix.config.arch }}-windows-static-md-release `
155161
-DVERBOSE_CONFIGURE=ON `
156162
--graphviz=build/target_graph.dot
157163
cmake --build build --target qbt_update_translations
@@ -196,7 +202,7 @@ jobs:
196202
- name: Upload build artifacts
197203
uses: actions/upload-artifact@v4
198204
with:
199-
name: qBittorrent-CI_Windows-x64_libtorrent-${{ matrix.libt_version }}
205+
name: qBittorrent-CI_Windows-${{ matrix.config.arch }}_libtorrent-${{ matrix.libt_version }}
200206
path: upload
201207

202208
- name: Install NSIS
@@ -207,10 +213,10 @@ jobs:
207213
- name: Create installer
208214
run: |
209215
7z x -o"dist/windows/" "dist/windows/NSISPlugins.zip"
210-
makensis /DQBT_DIST_DIR="../../upload/qBittorrent" /WX dist/windows/qbittorrent.nsi
216+
makensis /DQBT_CPU_ARCH="${{ matrix.config.arch }}" /DQBT_DIST_DIR="../../upload/qBittorrent" /WX dist/windows/qbittorrent.nsi
211217
212218
- name: Upload installer
213219
uses: actions/upload-artifact@v4
214220
with:
215-
name: qBittorrent-CI_Windows-x64_libtorrent-${{ matrix.libt_version }}-setup
221+
name: qBittorrent-CI_Windows-${{ matrix.config.arch }}_libtorrent-${{ matrix.libt_version }}-setup
216222
path: dist/windows/qbittorrent_*_setup.exe

dist/windows/config.nsh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,15 @@
3535
;End of user configurable options
3636
;==============================================================================
3737

38+
; QBT_CPU_ARCH (x64 or arm64)
39+
!define /ifndef QBT_CPU_ARCH "x64"
40+
3841
!ifndef QBT_INSTALLER_WINDOWNAME | QBT_INSTALLER_FILENAME
3942
; The name of the installer
40-
!define QBT_INSTALLER_WINDOWNAME "${QBT_VERSION} x64"
43+
!define QBT_INSTALLER_WINDOWNAME "${QBT_VERSION} ${QBT_CPU_ARCH}"
4144

4245
; The file to write
43-
!define QBT_INSTALLER_FILENAME "${QBT_VERSION}_x64"
46+
!define QBT_INSTALLER_FILENAME "${QBT_VERSION}_${QBT_CPU_ARCH}"
4447
!endif
4548

4649
!define /ifndef QBT_DIST_DIR "qBittorrent"

dist/windows/installer-translations/afrikaans.nsh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ LangString inst_requires_64bit ${LANG_AFRIKAANS} "This installer works only in 6
3232
LangString inst_requires_win10 ${LANG_AFRIKAANS} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
3333
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
3434
LangString inst_uninstall_link_description ${LANG_AFRIKAANS} "Uninstall qBittorrent"
35+
;LangString inst_arch_mismatch_x64_on_arm64 ${LANG_ENGLISH} "Error: This x64 version of qBittorrent cannot run on ARM64 systems. Please download the ARM64 installer."
36+
LangString inst_arch_mismatch_x64_on_arm64 ${LANG_AFRIKAANS} "This x64 version of qBittorrent cannot run on ARM64 systems. Please download the ARM64 installer."
37+
;LangString inst_arch_mismatch_arm64_on_x64 ${LANG_ENGLISH} "Error: This ARM64 version of qBittorrent cannot run on x64 systems. Please download the x64 installer."
38+
LangString inst_arch_mismatch_arm64_on_x64 ${LANG_AFRIKAANS} "This ARM64 version of qBittorrent cannot run on x64 systems. Please download the x64 installer."
39+
3540

3641
;------------------------------------
3742
;Uninstaller strings

dist/windows/installer-translations/albanian.nsh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ LangString inst_requires_win7 ${LANG_ALBANIAN} "This qBittorrent version require
3434
LangString inst_requires_win10 ${LANG_ALBANIAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
3535
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
3636
LangString inst_uninstall_link_description ${LANG_ALBANIAN} "Uninstall qBittorrent"
37+
;LangString inst_arch_mismatch_x64_on_arm64 ${LANG_ENGLISH} "Error: This x64 version of qBittorrent cannot run on ARM64 systems. Please download the ARM64 installer."
38+
LangString inst_arch_mismatch_x64_on_arm64 ${LANG_ALBANIAN} "This x64 version of qBittorrent cannot run on ARM64 systems. Please download the ARM64 installer."
39+
;LangString inst_arch_mismatch_arm64_on_x64 ${LANG_ENGLISH} "Error: This ARM64 version of qBittorrent cannot run on x64 systems. Please download the x64 installer."
40+
LangString inst_arch_mismatch_arm64_on_x64 ${LANG_ALBANIAN} "This ARM64 version of qBittorrent cannot run on x64 systems. Please download the x64 installer."
41+
3742

3843
;------------------------------------
3944
;Uninstaller strings

dist/windows/installer-translations/arabic.nsh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ LangString inst_requires_64bit ${LANG_ARABIC} "هذا المثبت يعمل فق
3232
LangString inst_requires_win10 ${LANG_ARABIC} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
3333
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
3434
LangString inst_uninstall_link_description ${LANG_ARABIC} "Uninstall qBittorrent"
35+
;LangString inst_arch_mismatch_x64_on_arm64 ${LANG_ENGLISH} "Error: This x64 version of qBittorrent cannot run on ARM64 systems. Please download the ARM64 installer."
36+
LangString inst_arch_mismatch_x64_on_arm64 ${LANG_ARABIC} "This x64 version of qBittorrent cannot run on ARM64 systems. Please download the ARM64 installer."
37+
;LangString inst_arch_mismatch_arm64_on_x64 ${LANG_ENGLISH} "Error: This ARM64 version of qBittorrent cannot run on x64 systems. Please download the x64 installer."
38+
LangString inst_arch_mismatch_arm64_on_x64 ${LANG_ARABIC} "This ARM64 version of qBittorrent cannot run on x64 systems. Please download the x64 installer."
39+
3540

3641
;------------------------------------
3742
;Uninstaller strings

dist/windows/installer-translations/basque.nsh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ LangString inst_requires_64bit ${LANG_BASQUE} "This installer works only in 64-b
3232
LangString inst_requires_win10 ${LANG_BASQUE} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
3333
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
3434
LangString inst_uninstall_link_description ${LANG_BASQUE} "Uninstall qBittorrent"
35+
;LangString inst_arch_mismatch_x64_on_arm64 ${LANG_ENGLISH} "Error: This x64 version of qBittorrent cannot run on ARM64 systems. Please download the ARM64 installer."
36+
LangString inst_arch_mismatch_x64_on_arm64 ${LANG_BASQUE} "This x64 version of qBittorrent cannot run on ARM64 systems. Please download the ARM64 installer."
37+
;LangString inst_arch_mismatch_arm64_on_x64 ${LANG_ENGLISH} "Error: This ARM64 version of qBittorrent cannot run on x64 systems. Please download the x64 installer."
38+
LangString inst_arch_mismatch_arm64_on_x64 ${LANG_BASQUE} "This ARM64 version of qBittorrent cannot run on x64 systems. Please download the x64 installer."
3539

3640
;------------------------------------
3741
;Uninstaller strings

dist/windows/installer-translations/belarusian.nsh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ LangString inst_requires_64bit ${LANG_BELARUSIAN} "This installer works only in
3232
LangString inst_requires_win10 ${LANG_BELARUSIAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
3333
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
3434
LangString inst_uninstall_link_description ${LANG_BELARUSIAN} "Uninstall qBittorrent"
35+
;LangString inst_arch_mismatch_x64_on_arm64 ${LANG_ENGLISH} "Error: This x64 version of qBittorrent cannot run on ARM64 systems. Please download the ARM64 installer."
36+
LangString inst_arch_mismatch_x64_on_arm64 ${LANG_BELARUSIAN} "This x64 version of qBittorrent cannot run on ARM64 systems. Please download the ARM64 installer."
37+
;LangString inst_arch_mismatch_arm64_on_x64 ${LANG_ENGLISH} "Error: This ARM64 version of qBittorrent cannot run on x64 systems. Please download the x64 installer."
38+
LangString inst_arch_mismatch_arm64_on_x64 ${LANG_BELARUSIAN} "This ARM64 version of qBittorrent cannot run on x64 systems. Please download the x64 installer."
39+
3540

3641
;------------------------------------
3742
;Uninstaller strings

dist/windows/installer-translations/bosnian.nsh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ LangString inst_requires_64bit ${LANG_BOSNIAN} "This installer works only in 64-
3232
LangString inst_requires_win10 ${LANG_BOSNIAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
3333
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
3434
LangString inst_uninstall_link_description ${LANG_BOSNIAN} "Uninstall qBittorrent"
35+
;LangString inst_arch_mismatch_x64_on_arm64 ${LANG_ENGLISH} "Error: This x64 version of qBittorrent cannot run on ARM64 systems. Please download the ARM64 installer."
36+
LangString inst_arch_mismatch_x64_on_arm64 ${LANG_BOSNIAN} "This x64 version of qBittorrent cannot run on ARM64 systems. Please download the ARM64 installer."
37+
;LangString inst_arch_mismatch_arm64_on_x64 ${LANG_ENGLISH} "Error: This ARM64 version of qBittorrent cannot run on x64 systems. Please download the x64 installer."
38+
LangString inst_arch_mismatch_arm64_on_x64 ${LANG_BOSNIAN} "This ARM64 version of qBittorrent cannot run on x64 systems. Please download the x64 installer."
39+
3540

3641
;------------------------------------
3742
;Uninstaller strings

dist/windows/installer-translations/breton.nsh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ LangString inst_requires_64bit ${LANG_BRETON} "This installer works only in 64-b
3232
LangString inst_requires_win10 ${LANG_BRETON} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
3333
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
3434
LangString inst_uninstall_link_description ${LANG_BRETON} "Uninstall qBittorrent"
35+
;LangString inst_arch_mismatch_x64_on_arm64 ${LANG_ENGLISH} "Error: This x64 version of qBittorrent cannot run on ARM64 systems. Please download the ARM64 installer."
36+
LangString inst_arch_mismatch_x64_on_arm64 ${LANG_BRETON} "This x64 version of qBittorrent cannot run on ARM64 systems. Please download the ARM64 installer."
37+
;LangString inst_arch_mismatch_arm64_on_x64 ${LANG_ENGLISH} "Error: This ARM64 version of qBittorrent cannot run on x64 systems. Please download the x64 installer."
38+
LangString inst_arch_mismatch_arm64_on_x64 ${LANG_BRETON} "This ARM64 version of qBittorrent cannot run on x64 systems. Please download the x64 installer."
3539

3640
;------------------------------------
3741
;Uninstaller strings

dist/windows/installer-translations/bulgarian.nsh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ LangString inst_requires_64bit ${LANG_BULGARIAN} "This installer works only in 6
3232
LangString inst_requires_win10 ${LANG_BULGARIAN} "This installer requires at least Windows 10 (1809) / Windows Server 2019."
3333
;LangString inst_uninstall_link_description ${LANG_ENGLISH} "Uninstall qBittorrent"
3434
LangString inst_uninstall_link_description ${LANG_BULGARIAN} "Uninstall qBittorrent"
35+
;LangString inst_arch_mismatch_x64_on_arm64 ${LANG_ENGLISH} "Error: This x64 version of qBittorrent cannot run on ARM64 systems. Please download the ARM64 installer."
36+
LangString inst_arch_mismatch_x64_on_arm64 ${LANG_BULGARIAN} "This x64 version of qBittorrent cannot run on ARM64 systems. Please download the ARM64 installer."
37+
;LangString inst_arch_mismatch_arm64_on_x64 ${LANG_ENGLISH} "Error: This ARM64 version of qBittorrent cannot run on x64 systems. Please download the x64 installer."
38+
LangString inst_arch_mismatch_arm64_on_x64 ${LANG_BULGARIAN} "This ARM64 version of qBittorrent cannot run on x64 systems. Please download the x64 installer."
3539

3640
;------------------------------------
3741
;Uninstaller strings

0 commit comments

Comments
 (0)