Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
35 changes: 16 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@ jobs:
uses: actions/checkout@v5
- name: Build
run: |
cmake -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_BUILD_TYPE=RelWithDebInfo -S . -B build
cmake -S . -B build -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build --target pkgbuild
- name: Archive artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: macOS
path: build/*.pkg
windows:
name: Build on Windows
runs-on: windows-2025
runs-on: ${{ matrix.platform == 'arm64' && 'windows-11-arm' || 'windows-2025' }}
strategy:
matrix:
vcver: [143]
platform: [x64, arm64]
env:
VER_SUFFIX: .VS${{ matrix.vcver }}
steps:
Expand All @@ -38,35 +39,31 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/vcpkg_cache
key: vcpkg-${{ matrix.vcver }}-${{ hashFiles('vcpkg.json') }}
- name: Prepare vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgJsonGlob: ./vcpkg.json
runVcpkgInstall: true
env:
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/build/vcpkg_installed
key: vcpkg-${{ matrix.vcver }}-${{ matrix.platform }}-${{ hashFiles('vcpkg.json') }}
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
version: 6.10.0
arch: win64_msvc2022_64
version: 6.10.1
arch: ${{ matrix.platform == 'arm64' && 'win64_msvc2022_arm64' || 'win64_msvc2022_64' }}
cache: true
- name: Setup dev env
uses: ilammy/msvc-dev-cmd@v1
with:
arch: x64
arch: ${{ matrix.platform }}
- name: Install WiX
run: |
dotnet tool install -g wix --version 6.0.2
wix extension -g add WixToolset.UI.wixext/6.0.2
- name: Build
env:
VCPKG_BINARY_SOURCES: clear;files,${{ github.workspace }}/vcpkg_cache,readwrite
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_TOOLCHAIN_FILE=${{ env.RUNVCPKG_VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake
cmake -A ${{ matrix.platform }} -S . -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo `
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake `
-DVCPKG_TARGET_TRIPLET=${{ matrix.platform }}-windows
cmake --build build --target installer
- name: Archive artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: msi_${{ matrix.vcver }}_x64
name: msi_${{ matrix.vcver }}_${{ matrix.platform }}
path: build/*.msi
3 changes: 0 additions & 3 deletions Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ Application::Application( int &argc, char **argv )
qInstallMessageHandler( msgHandler );

QTranslator *qt = new QTranslator( this );
QTranslator *common = new QTranslator( this );
QTranslator *t = new QTranslator( this );
QString lang;
auto languages = QLocale().uiLanguages().first();
Expand All @@ -65,10 +64,8 @@ Application::Application( int &argc, char **argv )
else
lang = u"en"_s;
void(qt->load(":/qtbase_%1.qm"_L1.arg(lang)));
void(common->load(":/common_%1.qm"_L1.arg(lang)));
void(t->load(":/idupdater_%1.qm"_L1.arg(lang)));
installTranslator( qt );
installTranslator( common );
installTranslator( t );
#ifdef NDEBUG
setLibraryPaths({ applicationDirPath() });
Expand Down
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ else()
set(CONFIG_DIR ${CMAKE_CURRENT_BINARY_DIR})

find_package(OpenSSL 3.0.0 REQUIRED)
find_package(Qt6 6.0.0 REQUIRED COMPONENTS Core Widgets Network LinguistTools)
find_package(Qt6 6.9.0 REQUIRED COMPONENTS Core Widgets Network LinguistTools)

add_executable(${PROJECT_NAME} WIN32
${SOURCES}
Expand All @@ -173,7 +173,7 @@ else()
INTERPROCEDURAL_OPTIMIZATION_DEBUG NO
)
target_include_directories(${PROJECT_NAME} PRIVATE common/qtsingleapplication/src)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_20)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_23)
target_compile_definitions(${PROJECT_NAME} PRIVATE
WIN32_LEAN_AND_MEAN
UNICODE
Expand All @@ -189,6 +189,7 @@ else()
common/translations/common_et.ts common/translations/common_ru.ts
common/translations/qtbase_et.ts common/translations/qtbase_ru.ts
RESOURCE_PREFIX /
LUPDATE_OPTIONS -locations none
)
qt_add_resources(${PROJECT_NAME} icon FILES appicon.png)
qt_add_resources(${PROJECT_NAME} config BASE ${CONFIG_DIR} PREFIX / FILES
Expand All @@ -202,16 +203,15 @@ else()
get_filename_component(SSL_PATH "${OPENSSL_INCLUDE_DIR}/../bin" ABSOLUTE)
endif()
set(MSI_FILE "ID-Updater-${VERSION}$ENV{VER_SUFFIX}.$ENV{PLATFORM}")
get_target_property(qtCore_install_prefix Qt6::qmake IMPORTED_LOCATION)
get_filename_component(qtCore_install_prefix ${qtCore_install_prefix} DIRECTORY)
get_filename_component(QT_BASE_DIR "${Qt6_DIR}/../../.." ABSOLUTE)
add_custom_target(installer DEPENDS ${PROJECT_NAME}
COMMAND wix.exe build -nologo
-arch $ENV{PLATFORM}
-ext WixToolset.UI.wixext
-bv WixUIDialogBmp=${CMAKE_SOURCE_DIR}/common/dlgbmp.bmp
-bv WixUIBannerBmp=${CMAKE_SOURCE_DIR}/common/banner.bmp
-d appicon=${CMAKE_SOURCE_DIR}/appicon.ico
-d qt_path=${qtCore_install_prefix}
-d qt_path=${QT_BASE_DIR}/bin
-d qt_suffix=$<$<CONFIG:Debug>:d>
-d libs_path="${SSL_PATH}"
-d updater_path=$<TARGET_FILE:${PROJECT_NAME}>
Expand Down
18 changes: 8 additions & 10 deletions ScheduledUpdateTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,13 @@
#endif

template <class T>
class CPtr
struct CPtr
{
T *d;
public:
CPtr(T *p = nullptr): d(p) {}
~CPtr() { if(d) d->Release(); }
inline T* operator->() const { return d; }
inline operator T*() const { return d; }
inline T** operator&() { return &d; }
T *d{};
~CPtr() { if(d) d->Release(); }
inline T* operator->() const { return d; }
inline operator T*() const { return d; }
inline T** operator&() { return &d; }
};

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

CPtr<ITaskSettings> settings;
if( SUCCEEDED(task->get_Settings( &settings )) )
if(CPtr<ITaskSettings> settings;
SUCCEEDED(task->get_Settings(&settings)))
{
settings->put_StartWhenAvailable(VARIANT_TRUE);
settings->put_RunOnlyIfNetworkAvailable(VARIANT_TRUE);
Expand Down
30 changes: 12 additions & 18 deletions idupdater.wxs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?if $(sys.BUILDARCH) = x64 ?>
<?define OpenSSLSuffix = "-x64" ?>
<?else?>
<?if $(sys.BUILDARCH) = x86 ?>
<?define OpenSSLSuffix = "" ?>
<?else?>
<?define OpenSSLSuffix = "-$(sys.BUILDARCH)" ?>
<?endif?>

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

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"
xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<Package Name="Open-EID Updater" UpgradeCode="d3aa8bd7-e1e6-46d0-97a6-c9b87d2b830b"
<Package Name="Open-EID Updater $(sys.BUILDARCH)" UpgradeCode="d3aa8bd7-e1e6-46d0-97a6-c9b87d2b830b"
Language="1033" Version="!(bind.FileVersion.id_updater.exe)" Codepage="1251" Manufacturer="RIA" InstallerVersion="500">
<MediaTemplate EmbedCab="yes" CompressionLevel="high" />
<Icon Id="appicon.ico" SourceFile="$(var.appicon)" />
Expand All @@ -35,7 +35,7 @@
<File Id="id_updater.exe" Source="$(var.updater_path)" KeyPath="yes" />
<RegistryValue Root="HKMU" Key="Software\[Manufacturer]\Open-EID"
Name="Installed" Value="[INSTALLFOLDER]" Type="string" />
<?if $(sys.BUILDARCH) = x64 ?>
<?if $(sys.BUILDARCH) != x86 ?>
<RegistryValue Root="HKMU" Key="Software\Wow6432Node\[Manufacturer]\Open-EID"
Name="Installed" Value="[INSTALLFOLDER]" Type="string" />
<?endif?>
Expand All @@ -55,21 +55,15 @@
<File Name="Qt6PrintSupport$(var.qt_suffix).dll" />
<File Name="Qt6Svg$(var.qt_suffix).dll" />
<File Name="Qt6Widgets$(var.qt_suffix).dll" />
<File Name="Qt6SvgWidgets$(var.qt_suffix).dll" />
<?if $(sys.BUILDARCH) != arm64 ?>
<File Name="D3DCompiler_47.dll" />
<File Name="opengl32sw.dll" />
<File Name="Qt6SvgWidgets$(var.qt_suffix).dll" />
<Directory Id="platforms" Name="platforms">
<File Source="$(var.qt_path)\..\plugins\platforms\qwindows$(var.qt_suffix).dll" />
</Directory>
<Directory Id="tls" Name="tls">
<File Source="$(var.qt_path)\..\plugins\tls\qopensslbackend$(var.qt_suffix).dll" />
</Directory>
<Directory Id="styles" Name="styles">
<File Source="$(var.qt_path)\..\plugins\styles\qmodernwindowsstyle$(var.qt_suffix).dll" />
</Directory>
<Directory Id="imageformats" Name="imageformats">
<File Source="$(var.qt_path)\..\plugins\imageformats\qsvg$(var.qt_suffix).dll" />
</Directory>
<?endif?>
<File Subdirectory="platforms" Source="$(var.qt_path)\..\plugins\platforms\qwindows$(var.qt_suffix).dll" />
<File Subdirectory="tls" Source="$(var.qt_path)\..\plugins\tls\qopensslbackend$(var.qt_suffix).dll" />
<File Subdirectory="styles" Source="$(var.qt_path)\..\plugins\styles\qmodernwindowsstyle$(var.qt_suffix).dll" />
<File Subdirectory="imageformats" Source="$(var.qt_path)\..\plugins\imageformats\qsvg$(var.qt_suffix).dll" />
</Directory>
</StandardDirectory>

Expand Down
11 changes: 11 additions & 0 deletions idupdater_et.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@
<translation>Viga ajakava seadistamisel, palun kontrolli õigusi. Proovi uuesti administraatori õigustega.</translation>
</message>
</context>
<context>
<name>Configuration</name>
<message>
<source>The configuration file located on the server cannot be validated.</source>
<translation>Serveris olev konfiguratsioonifail ei valideeru.</translation>
</message>
<message>
<source>Your computer&apos;s configuration file is later than the server has.</source>
<translation>Sinu arvutis on uuem konfiguratsioonifail kui serveris.</translation>
</message>
</context>
<context>
<name>idupdater</name>
<message>
Expand Down
11 changes: 11 additions & 0 deletions idupdater_ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@
<translation>Не удалось создать &quot;Назначенное задание&quot;. Попробуйте повторить в правах администратора.</translation>
</message>
</context>
<context>
<name>Configuration</name>
<message>
<source>The configuration file located on the server cannot be validated.</source>
<translation>Находящийся на сервере конфигурационный файл не валидируется.</translation>
</message>
<message>
<source>Your computer&apos;s configuration file is later than the server has.</source>
<translation>Находящийся на Вашем компьютере конфигурационный файл новее файла на сервере.</translation>
</message>
</context>
<context>
<name>idupdater</name>
<message>
Expand Down