Skip to content

Commit 84df505

Browse files
committed
Windows arm64
IB-6662 Signed-off-by: Raul Metsma <[email protected]>
1 parent dd6bc25 commit 84df505

File tree

8 files changed

+64
-56
lines changed

8 files changed

+64
-56
lines changed

.github/workflows/build.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,20 @@ jobs:
1414
uses: actions/checkout@v5
1515
- name: Build
1616
run: |
17-
cmake -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_BUILD_TYPE=RelWithDebInfo -S . -B build
17+
cmake -S . -B build -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_BUILD_TYPE=RelWithDebInfo
1818
cmake --build build --target pkgbuild
1919
- name: Archive artifacts
20-
uses: actions/upload-artifact@v4
20+
uses: actions/upload-artifact@v5
2121
with:
2222
name: macOS
2323
path: build/*.pkg
2424
windows:
2525
name: Build on Windows
26-
runs-on: windows-2025
26+
runs-on: ${{ matrix.platform == 'arm64' && 'windows-11-arm' || 'windows-2025' }}
2727
strategy:
2828
matrix:
2929
vcver: [143]
30+
platform: [x64, arm64]
3031
env:
3132
VER_SUFFIX: .VS${{ matrix.vcver }}
3233
steps:
@@ -38,35 +39,31 @@ jobs:
3839
uses: actions/cache@v4
3940
with:
4041
path: ${{ github.workspace }}/vcpkg_cache
41-
key: vcpkg-${{ matrix.vcver }}-${{ hashFiles('vcpkg.json') }}
42-
- name: Prepare vcpkg
43-
uses: lukka/run-vcpkg@v11
44-
with:
45-
vcpkgJsonGlob: ./vcpkg.json
46-
runVcpkgInstall: true
47-
env:
48-
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
49-
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/build/vcpkg_installed
42+
key: vcpkg-${{ matrix.vcver }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }}
5043
- name: Install Qt
5144
uses: jurplel/install-qt-action@v4
5245
with:
53-
version: 6.10.0
54-
arch: win64_msvc2022_64
46+
version: 6.10.1
47+
arch: ${{ matrix.platform == 'arm64' && 'win64_msvc2022_arm64' || 'win64_msvc2022_64' }}
48+
cache: true
5549
- name: Setup dev env
5650
uses: ilammy/msvc-dev-cmd@v1
5751
with:
58-
arch: x64
52+
arch: ${{ matrix.platform }}
5953
- name: Install WiX
6054
run: |
6155
dotnet tool install -g wix --version 6.0.2
6256
wix extension -g add WixToolset.UI.wixext/6.0.2
6357
- name: Build
58+
env:
59+
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
6460
run: |
65-
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo `
66-
-DCMAKE_TOOLCHAIN_FILE=${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake
61+
cmake -A ${{ matrix.platform }} -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo `
62+
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake `
63+
-DVCPKG_TARGET_TRIPLET=${{ matrix.platform }}-windows
6764
cmake --build build --target installer
6865
- name: Archive artifacts
69-
uses: actions/upload-artifact@v4
66+
uses: actions/upload-artifact@v5
7067
with:
71-
name: msi_${{ matrix.vcver }}_x64
68+
name: msi_${{ matrix.vcver }}_${{ matrix.platform }}
7269
path: build/*.msi

Application.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ Application::Application( int &argc, char **argv )
5454
qInstallMessageHandler( msgHandler );
5555

5656
QTranslator *qt = new QTranslator( this );
57-
QTranslator *common = new QTranslator( this );
5857
QTranslator *t = new QTranslator( this );
5958
QString lang;
6059
auto languages = QLocale().uiLanguages().first();
@@ -65,10 +64,8 @@ Application::Application( int &argc, char **argv )
6564
else
6665
lang = u"en"_s;
6766
void(qt->load(":/qtbase_%1.qm"_L1.arg(lang)));
68-
void(common->load(":/common_%1.qm"_L1.arg(lang)));
6967
void(t->load(":/idupdater_%1.qm"_L1.arg(lang)));
7068
installTranslator( qt );
71-
installTranslator( common );
7269
installTranslator( t );
7370
#ifdef NDEBUG
7471
setLibraryPaths({ applicationDirPath() });

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ else()
149149
set(CONFIG_DIR ${CMAKE_CURRENT_BINARY_DIR})
150150

151151
find_package(OpenSSL 3.0.0 REQUIRED)
152-
find_package(Qt6 6.0.0 REQUIRED COMPONENTS Core Widgets Network LinguistTools)
152+
find_package(Qt6 6.9.0 REQUIRED COMPONENTS Core Widgets Network LinguistTools)
153153

154154
add_executable(${PROJECT_NAME} WIN32
155155
${SOURCES}
@@ -173,7 +173,7 @@ else()
173173
INTERPROCEDURAL_OPTIMIZATION_DEBUG NO
174174
)
175175
target_include_directories(${PROJECT_NAME} PRIVATE common/qtsingleapplication/src)
176-
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
176+
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_23)
177177
target_compile_definitions(${PROJECT_NAME} PRIVATE
178178
WIN32_LEAN_AND_MEAN
179179
UNICODE
@@ -189,6 +189,7 @@ else()
189189
common/translations/common_et.ts common/translations/common_ru.ts
190190
common/translations/qtbase_et.ts common/translations/qtbase_ru.ts
191191
RESOURCE_PREFIX /
192+
LUPDATE_OPTIONS -locations none
192193
)
193194
qt_add_resources(${PROJECT_NAME} icon FILES appicon.png)
194195
qt_add_resources(${PROJECT_NAME} config BASE ${CONFIG_DIR} PREFIX / FILES
@@ -202,16 +203,15 @@ else()
202203
get_filename_component(SSL_PATH "${OPENSSL_INCLUDE_DIR}/../bin" ABSOLUTE)
203204
endif()
204205
set(MSI_FILE "ID-Updater-${VERSION}$ENV{VER_SUFFIX}.$ENV{PLATFORM}")
205-
get_target_property(qtCore_install_prefix Qt6::qmake IMPORTED_LOCATION)
206-
get_filename_component(qtCore_install_prefix ${qtCore_install_prefix} DIRECTORY)
206+
get_filename_component(QT_BASE_DIR "${Qt6_DIR}/../../.." ABSOLUTE)
207207
add_custom_target(installer DEPENDS ${PROJECT_NAME}
208208
COMMAND wix.exe build -nologo
209209
-arch $ENV{PLATFORM}
210210
-ext WixToolset.UI.wixext
211211
-bv WixUIDialogBmp=${CMAKE_SOURCE_DIR}/common/dlgbmp.bmp
212212
-bv WixUIBannerBmp=${CMAKE_SOURCE_DIR}/common/banner.bmp
213213
-d appicon=${CMAKE_SOURCE_DIR}/appicon.ico
214-
-d qt_path=${qtCore_install_prefix}
214+
-d qt_path=${QT_BASE_DIR}/bin
215215
-d qt_suffix=$<$<CONFIG:Debug>:d>
216216
-d libs_path="${SSL_PATH}"
217217
-d updater_path=$<TARGET_FILE:${PROJECT_NAME}>

ScheduledUpdateTask.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,13 @@
3232
#endif
3333

3434
template <class T>
35-
class CPtr
35+
struct CPtr
3636
{
37-
T *d;
38-
public:
39-
CPtr(T *p = nullptr): d(p) {}
40-
~CPtr() { if(d) d->Release(); }
41-
inline T* operator->() const { return d; }
42-
inline operator T*() const { return d; }
43-
inline T** operator&() { return &d; }
37+
T *d{};
38+
~CPtr() { if(d) d->Release(); }
39+
inline T* operator->() const { return d; }
40+
inline operator T*() const { return d; }
41+
inline T** operator&() { return &d; }
4442
};
4543

4644
class ScheduledUpdateTaskPrivate
@@ -79,8 +77,8 @@ bool ScheduledUpdateTask::configure(ScheduledUpdateTask::Interval interval)
7977
if( FAILED(d->service->NewTask( 0, &task )) )
8078
return false;
8179

82-
CPtr<ITaskSettings> settings;
83-
if( SUCCEEDED(task->get_Settings( &settings )) )
80+
if(CPtr<ITaskSettings> settings;
81+
SUCCEEDED(task->get_Settings(&settings)))
8482
{
8583
settings->put_StartWhenAvailable(VARIANT_TRUE);
8684
settings->put_RunOnlyIfNetworkAvailable(VARIANT_TRUE);

idupdater.wxs

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<?if $(sys.BUILDARCH) = x64 ?>
2-
<?define OpenSSLSuffix = "-x64" ?>
3-
<?else?>
1+
<?if $(sys.BUILDARCH) = x86 ?>
42
<?define OpenSSLSuffix = "" ?>
3+
<?else?>
4+
<?define OpenSSLSuffix = "-$(sys.BUILDARCH)" ?>
55
<?endif?>
66

77
<?if $(env.VisualStudioVersion) = "17.0" ?>
@@ -18,7 +18,7 @@
1818

1919
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
2020
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
21-
<Package Name="Open-EID Updater" UpgradeCode="d3aa8bd7-e1e6-46d0-97a6-c9b87d2b830b"
21+
<Package Name="Open-EID Updater $(sys.BUILDARCH)" UpgradeCode="d3aa8bd7-e1e6-46d0-97a6-c9b87d2b830b"
2222
Language="1033" Version="!(bind.FileVersion.id_updater.exe)" Codepage="1251" Manufacturer="RIA" InstallerVersion="500">
2323
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
2424
<Icon Id="appicon.ico" SourceFile="$(var.appicon)" />
@@ -35,7 +35,7 @@
3535
<File Id="id_updater.exe" Source="$(var.updater_path)" KeyPath="yes" />
3636
<RegistryValue Root="HKMU" Key="Software\[Manufacturer]\Open-EID"
3737
Name="Installed" Value="[INSTALLFOLDER]" Type="string" />
38-
<?if $(sys.BUILDARCH) = x64 ?>
38+
<?if $(sys.BUILDARCH) != x86 ?>
3939
<RegistryValue Root="HKMU" Key="Software\Wow6432Node\[Manufacturer]\Open-EID"
4040
Name="Installed" Value="[INSTALLFOLDER]" Type="string" />
4141
<?endif?>
@@ -55,21 +55,15 @@
5555
<File Name="Qt6PrintSupport$(var.qt_suffix).dll" />
5656
<File Name="Qt6Svg$(var.qt_suffix).dll" />
5757
<File Name="Qt6Widgets$(var.qt_suffix).dll" />
58+
<File Name="Qt6SvgWidgets$(var.qt_suffix).dll" />
59+
<?if $(sys.BUILDARCH) != arm64 ?>
5860
<File Name="D3DCompiler_47.dll" />
5961
<File Name="opengl32sw.dll" />
60-
<File Name="Qt6SvgWidgets$(var.qt_suffix).dll" />
61-
<Directory Id="platforms" Name="platforms">
62-
<File Source="$(var.qt_path)\..\plugins\platforms\qwindows$(var.qt_suffix).dll" />
63-
</Directory>
64-
<Directory Id="tls" Name="tls">
65-
<File Source="$(var.qt_path)\..\plugins\tls\qopensslbackend$(var.qt_suffix).dll" />
66-
</Directory>
67-
<Directory Id="styles" Name="styles">
68-
<File Source="$(var.qt_path)\..\plugins\styles\qmodernwindowsstyle$(var.qt_suffix).dll" />
69-
</Directory>
70-
<Directory Id="imageformats" Name="imageformats">
71-
<File Source="$(var.qt_path)\..\plugins\imageformats\qsvg$(var.qt_suffix).dll" />
72-
</Directory>
62+
<?endif?>
63+
<File Subdirectory="platforms" Source="$(var.qt_path)\..\plugins\platforms\qwindows$(var.qt_suffix).dll" />
64+
<File Subdirectory="tls" Source="$(var.qt_path)\..\plugins\tls\qopensslbackend$(var.qt_suffix).dll" />
65+
<File Subdirectory="styles" Source="$(var.qt_path)\..\plugins\styles\qmodernwindowsstyle$(var.qt_suffix).dll" />
66+
<File Subdirectory="imageformats" Source="$(var.qt_path)\..\plugins\imageformats\qsvg$(var.qt_suffix).dll" />
7367
</Directory>
7468
</StandardDirectory>
7569

idupdater_et.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@
3232
<translation>Viga ajakava seadistamisel, palun kontrolli õigusi. Proovi uuesti administraatori õigustega.</translation>
3333
</message>
3434
</context>
35+
<context>
36+
<name>Configuration</name>
37+
<message>
38+
<source>The configuration file located on the server cannot be validated.</source>
39+
<translation>Serveris olev konfiguratsioonifail ei valideeru.</translation>
40+
</message>
41+
<message>
42+
<source>Your computer&apos;s configuration file is later than the server has.</source>
43+
<translation>Sinu arvutis on uuem konfiguratsioonifail kui serveris.</translation>
44+
</message>
45+
</context>
3546
<context>
3647
<name>idupdater</name>
3748
<message>

idupdater_ru.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@
3232
<translation>Не удалось создать &quot;Назначенное задание&quot;. Попробуйте повторить в правах администратора.</translation>
3333
</message>
3434
</context>
35+
<context>
36+
<name>Configuration</name>
37+
<message>
38+
<source>The configuration file located on the server cannot be validated.</source>
39+
<translation>Находящийся на сервере конфигурационный файл не валидируется.</translation>
40+
</message>
41+
<message>
42+
<source>Your computer&apos;s configuration file is later than the server has.</source>
43+
<translation>Находящийся на Вашем компьютере конфигурационный файл новее файла на сервере.</translation>
44+
</message>
45+
</context>
3546
<context>
3647
<name>idupdater</name>
3748
<message>

0 commit comments

Comments
 (0)