From c71e65cfaac19eb04f3746600512339ad555933d Mon Sep 17 00:00:00 2001 From: lingyicute <160479206+lingyicute@users.noreply.github.com> Date: Sat, 12 Sep 2026 03:38:44 +0000 Subject: [PATCH 1/2] feat: Add Windows ARM64 support [initial] - build.yml: add native windows-11-arm jobs (Qt 6.8/6.10, the only versions with ARM64 binaries), install Qt win64_msvc2022_arm64, use the arm64 VS environment, and upload/publish -arm64 artifacts - PackagingWindows.cmake: only ship the OpenSSL DLLs for x64 builds; ARM64 uses Qt's Schannel TLS backend - installer.nsi: only embed the OpenSSL DLLs when present in the package No C++ changes are required: as far as I know, the code and all thirdparty dependencies are architecture-neutral. --- .github/workflows/build.yml | 31 ++++++++++++++++++++++++++++--- cmake/PackagingWindows.cmake | 32 ++++++++++++++++++++++++-------- installer/installer.nsi | 5 ++++- 3 files changed, 56 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a8217a39a..d556d87ad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,17 @@ jobs: matrix: os: [ubuntu-24.04, windows-2022, macos-latest] qt_version: ["6.5", "6.8", "6.10"] + include: + - os: windows-11-arm + qt_version: "6.8" + qt_arch: win64_msvc2022_arm64 + vs_arch: arm64 + artifact_suffix: -arm64 + - os: windows-11-arm + qt_version: "6.10" + qt_arch: win64_msvc2022_arm64 + vs_arch: arm64 + artifact_suffix: -arm64 runs-on: ${{ matrix.os }} @@ -32,12 +43,13 @@ jobs: version: ${{ matrix.qt_version }} modules: 'qt5compat' cache: true + arch: ${{ matrix.qt_arch }} - name: Setup Visual Studio Tools if: runner.os == 'Windows' uses: egor-tensin/vs-shell@v2 with: - arch: x64 + arch: ${{ matrix.vs_arch || 'x64' }} - name: Install NSIS if: runner.os == 'Windows' @@ -81,14 +93,14 @@ jobs: uses: actions/upload-artifact@v7 if: runner.os == 'Windows' with: - name: NotepadNext-Windows-Qt${{ matrix.qt_version }}-Zip + name: NotepadNext-Windows-Qt${{ matrix.qt_version }}${{ matrix.artifact_suffix }}-Zip path: ${{ github.workspace }}/build/package/ - name: Upload Windows Installer uses: actions/upload-artifact@v7 if: runner.os == 'Windows' with: - name: NotepadNext-Windows-Qt${{ matrix.qt_version }}-Installer + name: NotepadNext-Windows-Qt${{ matrix.qt_version }}${{ matrix.artifact_suffix }}-Installer path: ${{ github.workspace }}/installer/NotepadNext*.exe - name: Upload MacOS dmg @@ -113,6 +125,7 @@ jobs: if: github.repository == 'dail8859/NotepadNext' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + QT_ARM64_RELEASE_VER: 6.8 steps: - name: Checkout Repository @@ -137,6 +150,18 @@ jobs: cd .. gh release upload ${{ github.ref_name }} NotepadNext-${{ github.ref_name }}-win64.zip + - name: Upload Windows arm64 Installer + run: | + mv NotepadNext-Windows-Qt$QT_ARM64_RELEASE_VER-arm64-Installer/NotepadNext-${{ github.ref_name }}-Installer.exe NotepadNext-${{ github.ref_name }}-Installer-arm64.exe + gh release upload ${{ github.ref_name }} NotepadNext-${{ github.ref_name }}-Installer-arm64.exe + + - name: Upload Windows arm64 Zip + run: | + cd NotepadNext-Windows-Qt$QT_ARM64_RELEASE_VER-arm64-Zip/ + zip -r ../NotepadNext-${{ github.ref_name }}-win64-arm64.zip . + cd .. + gh release upload ${{ github.ref_name }} NotepadNext-${{ github.ref_name }}-win64-arm64.zip + - name: Upload Linux AppImage run: | gh release upload ${{ github.ref_name }} NotepadNext-Linux-Qt$QT_RELEASE_VER-AppImage/NotepadNext-${{ github.ref_name }}-x86_64.AppImage diff --git a/cmake/PackagingWindows.cmake b/cmake/PackagingWindows.cmake index e089b6927..e713a1219 100644 --- a/cmake/PackagingWindows.cmake +++ b/cmake/PackagingWindows.cmake @@ -24,6 +24,28 @@ list(APPEND WINDEPLOYQT_ARGS "${PACKAGE_DIR}/NotepadNext.exe") file(GLOB EXTRA_DLLS "${EXTRA_DLL_DIR}/*.dll") +# Determine the target architecture. The extra OpenSSL DLLs used by the +# auto updater are only shipped for x64; ARM64 builds use Qt's Schannel +# TLS backend instead, so no OpenSSL DLLs are needed. +if(CMAKE_CXX_COMPILER_ARCHITECTURE_ID MATCHES "ARM64" OR CMAKE_SYSTEM_PROCESSOR MATCHES "ARM64|aarch64") + set(TARGET_ARCH "arm64") +else() + set(TARGET_ARCH "x64") +endif() + +set(OPENSSL_DLL_COMMANDS "") +if(TARGET_ARCH STREQUAL "x64") + list(APPEND OPENSSL_DLL_COMMANDS + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_SOURCE_DIR}/deploy/windows/libcrypto-1_1-x64.dll" + "${PACKAGE_DIR}/libcrypto-1_1-x64.dll" + + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_SOURCE_DIR}/deploy/windows/libssl-1_1-x64.dll" + "${PACKAGE_DIR}/libssl-1_1-x64.dll" + ) +endif() + # Define the package target add_custom_target(package COMMENT "Packaging NotepadNext for distribution" @@ -39,14 +61,8 @@ add_custom_target(package "${CMAKE_SOURCE_DIR}/LICENSE" "${PACKAGE_DIR}/LICENSE" - # Copy the two extra DLLs - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${CMAKE_SOURCE_DIR}/deploy/windows/libcrypto-1_1-x64.dll" - "${PACKAGE_DIR}/libcrypto-1_1-x64.dll" - - COMMAND ${CMAKE_COMMAND} -E copy_if_different - "${CMAKE_SOURCE_DIR}/deploy/windows/libssl-1_1-x64.dll" - "${PACKAGE_DIR}/libssl-1_1-x64.dll" + # Copy the two extra DLLs (x64 only, see TARGET_ARCH above) + ${OPENSSL_DLL_COMMANDS} # Run windeployqt with correct flags COMMAND windeployqt ${WINDEPLOYQT_ARGS} diff --git a/installer/installer.nsi b/installer/installer.nsi index 6f9a286d2..2cb5a77ff 100644 --- a/installer/installer.nsi +++ b/installer/installer.nsi @@ -243,7 +243,10 @@ ${MementoSection} "Auto Updater" SEC_AUTO_UPDATER SetRegView 64 SetOutPath $INSTDIR - File ..\build\package\libcrypto-1_1-x64.dll ..\build\package\libssl-1_1-x64.dll + # The OpenSSL DLLs are only shipped with x64 builds; ARM64 builds use Qt's Schannel TLS backend + !if /FILEEXISTS "..\build\package\libcrypto-1_1-x64.dll" + File ..\build\package\libcrypto-1_1-x64.dll ..\build\package\libssl-1_1-x64.dll + !endif WriteRegDWORD SHCTX "Software\NotepadNext\NotepadNext\" "AutoUpdate" 1 ${MementoSectionEnd} From 6b0ee237c59b74e8e654c8f70d52f52434ea235c Mon Sep 17 00:00:00 2001 From: lingyicute <160479206+lingyicute@users.noreply.github.com> Date: Sun, 13 Sep 2026 16:37:21 +0000 Subject: [PATCH 2/2] Use a dedicated updater platform key on ARM64 builds updates.json only points to the x64 installer, so ARM64 builds would be offered an installer they cannot use. Point ARM64 builds at a separate 'windows-arm64' key: until that key exists in updates.json, the updater always reports no update (effectively disabled), and once an ARM64 installer is published under that key updates start working with no further code changes. --- src/dialogs/MainWindow.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/dialogs/MainWindow.cpp b/src/dialogs/MainWindow.cpp index d689984a0..71c7682d0 100644 --- a/src/dialogs/MainWindow.cpp +++ b/src/dialogs/MainWindow.cpp @@ -2187,6 +2187,15 @@ void MainWindow::checkForUpdates(bool silent) qInfo(Q_FUNC_INFO); QString url = "https://github.com/dail8859/NotepadNext/raw/master/updates.json"; + +#if defined(_M_ARM64) || defined(__aarch64__) + // updates.json only points to the x64 installer, so ARM64 builds check + // the "windows-arm64" key instead. Until that key is added to the json, + // the updater will never report an available update which effectively + // disables the auto updater rather than downloading a useless x64 installer. + QSimpleUpdater::getInstance()->setPlatformKey(url, "windows-arm64"); +#endif + QSimpleUpdater::getInstance()->checkForUpdates(url); if (!silent) {