Skip to content

Commit a607af2

Browse files
authored
Windows arm64 (#99)
IB-6662 Signed-off-by: Raul Metsma <raul@metsma.ee>
1 parent 2c97b28 commit a607af2

File tree

9 files changed

+80
-61
lines changed

9 files changed

+80
-61
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,62 +11,59 @@ jobs:
1111
MACOSX_DEPLOYMENT_TARGET: 13.0
1212
steps:
1313
- name: Checkout
14-
uses: actions/checkout@v5
14+
uses: actions/checkout@v6
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@v5
20+
uses: actions/upload-artifact@v6
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:
3334
- name: Checkout
34-
uses: actions/checkout@v5
35+
uses: actions/checkout@v6
3536
with:
3637
submodules: recursive
3738
- name: Cache vcpkg
38-
uses: actions/cache@v4
39+
uses: actions/cache@v5
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.1
54-
arch: win64_msvc2022_64
46+
version: 6.10.2
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@v5
66+
uses: actions/upload-artifact@v6
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: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ else()
160160
set(CONFIG_DIR ${CMAKE_CURRENT_BINARY_DIR})
161161

162162
find_package(OpenSSL 3.0.0 REQUIRED)
163-
find_package(Qt6 6.0.0 REQUIRED COMPONENTS Core Widgets Network LinguistTools)
163+
find_package(Qt6 6.9.0 REQUIRED COMPONENTS Core Widgets Network LinguistTools)
164164

165165
add_executable(${PROJECT_NAME} WIN32
166166
${SOURCES}
@@ -184,7 +184,7 @@ else()
184184
INTERPROCEDURAL_OPTIMIZATION_DEBUG NO
185185
)
186186
target_include_directories(${PROJECT_NAME} PRIVATE common/qtsingleapplication/src)
187-
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
187+
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_23)
188188
target_compile_definitions(${PROJECT_NAME} PRIVATE
189189
WIN32_LEAN_AND_MEAN
190190
UNICODE
@@ -200,6 +200,7 @@ else()
200200
common/translations/common_et.ts common/translations/common_ru.ts
201201
common/translations/qtbase_et.ts common/translations/qtbase_ru.ts
202202
RESOURCE_PREFIX /
203+
LUPDATE_OPTIONS -locations none
203204
)
204205
qt_add_resources(${PROJECT_NAME} icon FILES appicon.png)
205206
qt_add_resources(${PROJECT_NAME} config BASE ${CONFIG_DIR} PREFIX / FILES
@@ -213,16 +214,15 @@ else()
213214
get_filename_component(SSL_PATH "${OPENSSL_INCLUDE_DIR}/../bin" ABSOLUTE)
214215
endif()
215216
set(MSI_FILE "ID-Updater-${VERSION}$ENV{VER_SUFFIX}.$ENV{PLATFORM}")
216-
get_target_property(qtCore_install_prefix Qt6::qmake IMPORTED_LOCATION)
217-
get_filename_component(qtCore_install_prefix ${qtCore_install_prefix} DIRECTORY)
217+
get_filename_component(QT_BASE_DIR "${Qt6_DIR}/../../.." ABSOLUTE)
218218
add_custom_target(installer DEPENDS ${PROJECT_NAME}
219219
COMMAND wix.exe build -nologo
220220
-arch $ENV{PLATFORM}
221221
-ext WixToolset.UI.wixext
222222
-bv WixUIDialogBmp=${CMAKE_SOURCE_DIR}/common/dlgbmp.bmp
223223
-bv WixUIBannerBmp=${CMAKE_SOURCE_DIR}/common/banner.bmp
224224
-d appicon=${CMAKE_SOURCE_DIR}/appicon.ico
225-
-d qt_path=${qtCore_install_prefix}
225+
-d qt_path=${QT_BASE_DIR}/bin
226226
-d qt_suffix=$<$<CONFIG:Debug>:d>
227227
-d libs_path="${SSL_PATH}"
228228
-d updater_path=$<TARGET_FILE:${PROJECT_NAME}>
@@ -238,7 +238,7 @@ else()
238238
list(APPEND SIGNCMD signtool.exe sign /a /v /s MY /n "${SIGNCERT}" /fd SHA256
239239
/du http://installer.id.ee /tr http://timestamp.digicert.com /td SHA256)
240240
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
241-
COMMAND ${SIGNCMD} "$<$<BOOL:${CROSSSIGNCERT}>:/ph;/ac;${CROSSSIGNCERT}>" $<TARGET_FILE:${PROJECT_NAME}>
241+
COMMAND ${SIGNCMD} "$<$<BOOL:${CROSSSIGNCERT}>:/ph;/ac;${CROSSSIGNCERT}>" $<TARGET_FILE:${PROJECT_NAME}> ${SSL_PATH}/*.dll
242242
COMMAND_EXPAND_LISTS
243243
)
244244
add_custom_command(TARGET installer POST_BUILD

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>

vcpkg.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
{
22
"name": "id-updater",
33
"dependencies": ["openssl"],
4-
"builtin-baseline": "bc38a15b0bee8bc48a49ea267cc32fbb49aedfc4"
4+
"builtin-baseline": "bc38a15b0bee8bc48a49ea267cc32fbb49aedfc4",
5+
"vcpkg-configuration": {
6+
"registries": [
7+
{
8+
"kind": "git",
9+
"repository": "https://github.com/open-eid/vcpkg-ports",
10+
"reference": "vcpkg-registry",
11+
"baseline": "316f4d642f489b7d23d97891ed73431e7394d749",
12+
"packages": ["openssl"]
13+
}
14+
]
15+
}
516
}

0 commit comments

Comments
 (0)