Compare commits

...

8 Commits

Author SHA1 Message Date
NickVs2015
08138c218c feat: update support arm 64 server 2025-12-05 15:41:48 +03:00
NickVs2015
3119a589fb feat: update support arm 64 new logic 2025-12-03 23:27:55 +03:00
NickVs2015
753a549938 feat: update support arm 64 logic, add upload win64 bin dir 2025-12-03 16:40:20 +03:00
NickVs2015
228dee7680 feat: addd support arm64 back to windeploy 2025-12-03 13:36:26 +03:00
NickVs2015
5133b4d6bb Add arm64 support 2025-12-03 10:02:49 +03:00
NickVs2015
fa50a07693 feat: win arm64 add support 2025-12-02 12:23:37 +03:00
NickVs2015
cf9196777c feat: win arm64 add support vc_redist 2025-12-02 12:23:37 +03:00
NickVs2015
0945997b34 feat: add support arm64 2025-12-02 12:23:37 +03:00
9 changed files with 451 additions and 31 deletions

View File

@@ -132,6 +132,8 @@ jobs:
setup-python: 'true'
tools: 'tools_ifw'
set-env: 'true'
aqtversion: '==3.1.21'
py7zrversion: '==0.22.*'
extra: '--external 7z --base ${{ env.QT_MIRROR }}'
- name: 'Setup mvsc'
@@ -143,20 +145,20 @@ jobs:
shell: cmd
run: |
set BUILD_ARCH=${{ env.BUILD_ARCH }}
set QT_BIN_DIR="${{ runner.temp }}\\Qt\\${{ env.QT_VERSION }}\\msvc2019_64\\bin"
set QIF_BIN_DIR="${{ runner.temp }}\\Qt\\Tools\\QtInstallerFramework\\${{ env.QIF_VERSION }}\\bin"
call deploy\\build_windows.bat
set "QT_BIN_DIR=${{ runner.temp }}\Qt\${{ env.QT_VERSION }}\msvc2019_64\bin"
set "QIF_BIN_DIR=${{ runner.temp }}\Qt\Tools\QtInstallerFramework\${{ env.QIF_VERSION }}\bin"
call deploy\build_windows.bat
- name: 'Rename Windows installer'
shell: cmd
run: |
copy AmneziaVPN_x${{ env.BUILD_ARCH }}.exe AmneziaVPN_%VERSION%_x64.exe
copy AmneziaVPN_x${{ env.BUILD_ARCH }}.exe AmneziaVPN_%VERSION%_x${{ env.BUILD_ARCH }}.exe
- name: 'Upload installer artifact'
uses: actions/upload-artifact@v4
with:
name: AmneziaVPN_${{ env.VERSION }}_x64.exe
path: AmneziaVPN_${{ env.VERSION }}_x64.exe
name: AmneziaVPN_${{ env.VERSION }}_x${{ env.BUILD_ARCH }}.exe
path: AmneziaVPN_${{ env.VERSION }}_x${{ env.BUILD_ARCH }}.exe
retention-days: 7
- name: 'Upload unpacked artifact'
@@ -166,6 +168,136 @@ jobs:
path: deploy\\build_${{ env.BUILD_ARCH }}\\client\\Release
retention-days: 7
# ------------------------------------------------------
Build-Windows-ARM64:
runs-on: windows-latest
env:
QT_VERSION: 6.8.3
QIF_VERSION: 4.7
BUILD_ARCH: arm64
PROD_AGW_PUBLIC_KEY: ${{ secrets.PROD_AGW_PUBLIC_KEY }}
PROD_S3_ENDPOINT: ${{ secrets.PROD_S3_ENDPOINT }}
DEV_AGW_PUBLIC_KEY: ${{ secrets.DEV_AGW_PUBLIC_KEY }}
DEV_AGW_ENDPOINT: ${{ secrets.DEV_AGW_ENDPOINT }}
DEV_S3_ENDPOINT: ${{ secrets.DEV_S3_ENDPOINT }}
FREE_V2_ENDPOINT: ${{ secrets.FREE_V2_ENDPOINT }}
PREM_V1_ENDPOINT: ${{ secrets.PREM_V1_ENDPOINT }}
steps:
- name: 'Get sources'
uses: actions/checkout@v4
with:
submodules: 'true'
fetch-depth: 10
- name: 'Get 3rd-prebuilt'
shell: bash
run: |
rm -rf client/3rd-prebuilt
- name: 'Checkout 3rd-prebuilt'
uses: actions/checkout@v4
with:
repository: amnezia-vpn/3rd-prebuilt
ref: feature/add-support-arm64
path: client/3rd-prebuilt
- name: 'Get version from CMakeLists.txt'
id: get_version
shell: bash
run: |
VERSION=$(grep 'set(AMNEZIAVPN_VERSION' CMakeLists.txt | sed -E 's/.*AMNEZIAVPN_VERSION ([0-9]+.[0-9]+.[0-9]+.[0-9]+)\)/\1/')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "Version: $VERSION"
- name: 'Setup ccache'
uses: hendrikmuhs/ccache-action@v1.2
- name: 'Cleanup Qt directory'
shell: pwsh
run: |
$baseDir = "${{ runner.temp }}"
$qtVersion = "${{ env.QT_VERSION }}"
# Handle both path formats (with \ and /)
$paths = @(
"$baseDir\Qt\$qtVersion\msvc2022_64",
"$baseDir/Qt/$qtVersion/msvc2022_64",
"$baseDir\Qt\$qtVersion\msvc2022_arm64",
"$baseDir/Qt/$qtVersion/msvc2022_arm64"
)
foreach ($path in $paths) {
if (Test-Path $path) {
Write-Host "Removing $path..."
Remove-Item -Path $path -Recurse -Force -ErrorAction SilentlyContinue
}
}
- name: 'Install Qt Desktop (host for cross-compilation)'
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2022_64'
modules: 'qtremoteobjects qt5compat qtshadertools'
dir: ${{ runner.temp }}
setup-python: 'true'
set-env: 'false'
aqtversion: '==3.3.0'
py7zrversion: '==0.22.*'
extra: '--base ${{ env.QT_MIRROR }}'
- name: 'Install Qt ARM64'
uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2022_arm64_cross_compiled'
modules: 'qtremoteobjects qt5compat qtshadertools'
dir: ${{ runner.temp }}
setup-python: 'true'
tools: 'tools_ifw'
set-env: 'false'
aqtversion: '==3.3.0'
py7zrversion: '==0.22.*'
extra: '--external 7z --base ${{ env.QT_MIRROR }}'
- name: 'Setup mvsc'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: 'x64_arm64'
- name: 'Build project'
shell: cmd
run: |
set BUILD_ARCH=${{ env.BUILD_ARCH }}
set "QT_BIN_DIR=${{ runner.temp }}\Qt\${{ env.QT_VERSION }}\msvc2022_arm64\bin"
set "QT_HOST_PATH=${{ runner.temp }}\Qt\${{ env.QT_VERSION }}\msvc2022_64"
set "QT_HOST_BIN_DIR=${{ runner.temp }}\Qt\${{ env.QT_VERSION }}\msvc2022_64\bin"
set "QIF_BIN_DIR=${{ runner.temp }}\Qt\Tools\QtInstallerFramework\${{ env.QIF_VERSION }}\bin"
call deploy\build_windows.bat
- name: 'Rename Windows installer'
shell: cmd
run: |
copy AmneziaVPN_x${{ env.BUILD_ARCH }}.exe AmneziaVPN_%VERSION%_x${{ env.BUILD_ARCH }}.exe
- name: 'Upload installer artifact'
uses: actions/upload-artifact@v4
with:
name: AmneziaVPN_${{ env.VERSION }}_x${{ env.BUILD_ARCH }}.exe
path: AmneziaVPN_${{ env.VERSION }}_x${{ env.BUILD_ARCH }}.exe
retention-days: 7
- name: 'Upload unpacked artifact'
uses: actions/upload-artifact@v4
with:
name: AmneziaVPN_Windows_ARM64_unpacked
path: deploy\\build_${{ env.BUILD_ARCH }}\\client\\Release
retention-days: 7
# ------------------------------------------------------
Build-iOS:

View File

@@ -39,6 +39,20 @@ endif()
find_package(Qt6 REQUIRED COMPONENTS ${PACKAGES})
# Diagnostic: Print Qt configuration
message(STATUS "=== Qt Configuration Diagnostics ===")
message(STATUS "Qt6_DIR: ${Qt6_DIR}")
message(STATUS "CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}")
message(STATUS "CMAKE_GENERATOR_PLATFORM: ${CMAKE_GENERATOR_PLATFORM}")
message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
if(TARGET Qt6::Core)
get_target_property(Qt6Core_LOCATION Qt6::Core LOCATION)
message(STATUS "Qt6::Core location: ${Qt6Core_LOCATION}")
get_target_property(Qt6Core_IMPLIB Qt6::Core IMPORTED_IMPLIB_RELEASE)
message(STATUS "Qt6::Core import library: ${Qt6Core_IMPLIB}")
endif()
message(STATUS "====================================")
set(LIBS ${LIBS}
Qt6::Core Qt6::Gui
Qt6::Network Qt6::Xml Qt6::RemoteObjects
@@ -199,7 +213,9 @@ target_compile_definitions(${PROJECT} PRIVATE "MZ_$<UPPER_CASE:${MZ_PLATFORM_NAM
# deploy artifacts required to run the application to the debug build folder
if(WIN32)
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ARM64")
set(DEPLOY_PLATFORM_PATH "windows/arm64")
elseif("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
set(DEPLOY_PLATFORM_PATH "windows/x64")
else()
set(DEPLOY_PLATFORM_PATH "windows/x32")

View File

@@ -15,17 +15,35 @@ set(OPENSSL_LIBRARIES_DIR "${OPENSSL_ROOT_DIR}/lib")
if(WIN32)
set(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/windows/include")
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
# Check for ARM64 architecture first (CMAKE_GENERATOR_PLATFORM is set to ARM64 for cross-compilation)
message(STATUS "=== 3rd Party Libraries Configuration ===")
message(STATUS "CMAKE_GENERATOR_PLATFORM: ${CMAKE_GENERATOR_PLATFORM}")
message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}")
message(STATUS "CMAKE_SIZEOF_VOID_P: ${CMAKE_SIZEOF_VOID_P}")
if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "ARM64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ARM64")
# ARM64: use ARM64 versions for both OpenSSL and libssh
message(STATUS "Building for Windows ARM64")
set(LIBSSH_LIB_PATH "${LIBSSH_ROOT_DIR}/windows/arm64/ssh.lib")
set(LIBSSH_INCLUDE_DIR "${LIBSSH_ROOT_DIR}/windows/arm64")
set(OPENSSL_LIB_SSL_PATH "${OPENSSL_ROOT_DIR}/windows/winarm64/libssl.lib")
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/windows/winarm64/libcrypto.lib")
message(STATUS "libssh: ${LIBSSH_LIB_PATH}")
message(STATUS "OpenSSL SSL: ${OPENSSL_LIB_SSL_PATH}")
message(STATUS "OpenSSL Crypto: ${OPENSSL_LIB_CRYPTO_PATH}")
elseif("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
message(STATUS "Building for Windows x64")
set(LIBSSH_LIB_PATH "${LIBSSH_ROOT_DIR}/windows/x86_64/ssh.lib")
set(LIBSSH_INCLUDE_DIR "${LIBSSH_ROOT_DIR}/windows/x86_64")
set(OPENSSL_LIB_SSL_PATH "${OPENSSL_ROOT_DIR}/windows/win64/libssl.lib")
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/windows/win64/libcrypto.lib")
else()
message(STATUS "Building for Windows x86")
set(LIBSSH_LIB_PATH "${LIBSSH_ROOT_DIR}/windows/x86/ssh.lib")
set(LIBSSH_INCLUDE_DIR "${LIBSSH_ROOT_DIR}/windows/x86")
set(OPENSSL_LIB_SSL_PATH "${OPENSSL_ROOT_DIR}/windows/win32/libssl.lib")
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/windows/win32/libcrypto.lib")
endif()
message(STATUS "==========================================")
elseif(APPLE AND NOT IOS)
if(MACOS_NE)
set(LIBSSH_LIB_PATH "${LIBSSH_ROOT_DIR}/macos/universal2/libssh.a")

View File

@@ -18,12 +18,23 @@ set APP_NAME=AmneziaVPN
set APP_FILENAME=%APP_NAME:"=%.exe
set APP_DOMAIN=org.amneziavpn.package
set OUT_APP_DIR=%WORK_DIR:"=%\client\release
set PREBILT_DEPLOY_DATA_DIR=%PROJECT_DIR:"=%\client\3rd-prebuilt\deploy-prebuilt\windows\x%BUILD_ARCH:"=%
set DEPLOY_DATA_DIR=%SCRIPT_DIR:"=%\data\windows\x%BUILD_ARCH:"=%
REM Determine architecture prefix for paths
if "%BUILD_ARCH%"=="arm64" (
set ARCH_PREFIX=arm64
) else (
set ARCH_PREFIX=x%BUILD_ARCH:"=%
)
set PREBILT_DEPLOY_DATA_DIR=%PROJECT_DIR:"=%\client\3rd-prebuilt\deploy-prebuilt\windows\%ARCH_PREFIX:"=%
set DEPLOY_DATA_DIR=%SCRIPT_DIR:"=%\data\windows\%ARCH_PREFIX:"=%
set INSTALLER_DATA_DIR=%WORK_DIR:"=%\installer\packages\%APP_DOMAIN:"=%\data
set TARGET_FILENAME=%PROJECT_DIR:"=%\%APP_NAME:"=%_x%BUILD_ARCH:"=%.exe
echo "Environment:"
echo "BUILD_ARCH: %BUILD_ARCH%"
echo "ARCH_PREFIX: %ARCH_PREFIX%"
if defined QT_HOST_PATH echo "QT_HOST_PATH: %QT_HOST_PATH%"
echo "WORK_DIR: %WORK_DIR%"
echo "APP_FILENAME: %APP_FILENAME%"
echo "PROJECT_DIR: %PROJECT_DIR%"
@@ -39,12 +50,64 @@ del %TARGET_FILENAME%
mkdir %WORK_DIR%
echo "Checking MSVC environment..."
where cl >nul 2>&1
if %errorlevel% equ 0 (
echo "MSVC compiler found"
cl 2>&1 | findstr /C:"Version"
) else (
echo "ERROR: MSVC compiler not found in PATH"
echo "Please ensure 'Setup mvsc' step in GitHub Actions workflow is configured correctly"
echo "Trying to find cl.exe..."
where cl 2>&1
exit /b 1
)
call "%QT_BIN_DIR:"=%\qt-cmake" --version
"%QT_BIN_DIR:"=%\windeployqt" -v
if defined QT_HOST_BIN_DIR (
"%QT_HOST_BIN_DIR:"=%\windeployqt" -v
) else (
"%QT_BIN_DIR:"=%\windeployqt" -v
)
cmake --version
set "QT_ROOT_DIR=%QT_BIN_DIR:\bin=%"
cd %PROJECT_DIR%
call cmake . -B %WORK_DIR% "-DCMAKE_BUILD_TYPE:STRING=Release" "-DCMAKE_PREFIX_PATH:PATH=%QT_BIN_DIR%"
if defined QT_HOST_PATH (
REM ARM64 cross-compilation - set generator platform to ARM64
REM CMAKE_PREFIX_PATH must point to Qt root (not bin), so CMake can find lib directory
echo "=== CMake Configuration for ARM64 ==="
echo "QT_BIN_DIR: %QT_BIN_DIR%"
echo "QT_ROOT_DIR: %QT_ROOT_DIR%"
echo "QT_HOST_PATH: %QT_HOST_PATH%"
echo "CMAKE_PREFIX_PATH: %QT_ROOT_DIR%"
echo "Generator Platform: ARM64"
echo "===================================="
REM Verify Qt ARM64 directories exist
if not exist "%QT_ROOT_DIR%" (
echo "ERROR: Qt ARM64 root directory not found at %QT_ROOT_DIR%"
exit /b 1
)
echo "Qt ARM64 root directory exists: %QT_ROOT_DIR%"
if not exist "%QT_ROOT_DIR%\lib" (
echo "ERROR: Qt ARM64 lib directory not found at %QT_ROOT_DIR%\lib"
exit /b 1
)
echo "Building for ARM64"
call cmake . -B %WORK_DIR% -A ARM64 "-DCMAKE_BUILD_TYPE:STRING=Release" "-DCMAKE_PREFIX_PATH:PATH=%QT_ROOT_DIR%" "-DQT_HOST_PATH:PATH=%QT_HOST_PATH%"
) else (
REM x64 build - QT_ROOT_DIR already calculated above
echo "=== CMake Configuration for x64 ==="
echo "QT_ROOT_DIR: %QT_ROOT_DIR%"
echo "===================================="
call cmake . -B %WORK_DIR% "-DCMAKE_BUILD_TYPE:STRING=Release" "-DCMAKE_PREFIX_PATH:PATH=%QT_ROOT_DIR%"
)
cd %WORK_DIR%
cmake --build . --config release -- /p:UseMultiToolTask=true /m
@@ -54,16 +117,125 @@ echo "Deploying..."
mkdir "%OUT_APP_DIR%"
copy "%WORK_DIR%\service\server\release\%APP_NAME%-service.exe" "%OUT_APP_DIR%"
rem copy "%WORK_DIR%\client\%APP_FILENAME%" "%OUT_APP_DIR%"
copy "%WORK_DIR%\client\Release\%APP_FILENAME%" "%OUT_APP_DIR%"
echo "Signing exe"
cd %OUT_APP_DIR%
signtool sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 *.exe
REM For ARM64 cross-compilation, use x64 signtool from host (ARM64 signtool won't run on x64 Windows)
if defined QT_HOST_BIN_DIR (
REM Find x64 signtool - look for x64 version in Windows Kits (skip arm64)
set SIGNGTOOL_PATH=
for /f "delims=" %%i in ('dir /b /s "C:\Program Files (x86)\Windows Kits\10\bin\*\x64\signtool.exe" 2^>nul') do (
set SIGNGTOOL_PATH=%%i
goto :found_signtool
)
:found_signtool
if defined SIGNGTOOL_PATH (
echo "Using x64 signtool: %SIGNGTOOL_PATH%"
"%SIGNGTOOL_PATH%" sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 *.exe
) else (
echo "Warning: Could not find x64 signtool, trying default signtool"
signtool sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 *.exe 2>nul || echo "Warning: Signing failed, continuing..."
)
) else (
signtool sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 *.exe
)
"%QT_BIN_DIR:"=%\windeployqt" --release --qmldir "%PROJECT_DIR:"=%\client" --force --no-translations "%OUT_APP_DIR:"=%\%APP_FILENAME:"=%"
REM For cross-compiled ARM64, use windeployqt from host Qt (x64) but point to ARM64 Qt libraries
if defined QT_HOST_BIN_DIR (
echo "Using host windeployqt for cross-compilation (to copy ARM64 libraries)"
echo "ARM64 exe file: %OUT_APP_DIR%\%APP_FILENAME%"
echo "ARM64 Qt path: %QT_BIN_DIR%"
REM Verify that ARM64 exe exists before running windeployqt
if not exist "%OUT_APP_DIR%\%APP_FILENAME%" (
echo "ERROR: ARM64 exe file not found: %OUT_APP_DIR%\%APP_FILENAME%"
exit /b 1
)
REM For ARM64 cross-compilation, manually copy all Qt ARM64 libraries
REM windeployqt from x64 host copies x64 libraries, not ARM64
echo "Manually copying ARM64 Qt libraries (windeployqt copies x64 instead)"
echo "ARM64 Qt path: %QT_BIN_DIR:"=%"
REM First, use windeployqt ONLY to detect QML dependencies (--dry-run would be ideal but not supported)
REM We'll let it run to create directory structure, then overwrite with ARM64 DLLs
echo "Running windeployqt to detect QML dependencies..."
"%QT_HOST_BIN_DIR:"=%\windeployqt" --release --qmldir "%PROJECT_DIR:"=%\client" --force --no-translations --compiler-runtime "%OUT_APP_DIR:"=%\%APP_FILENAME:"=%"
REM Now overwrite all x64 DLLs with ARM64 DLLs
echo "Overwriting x64 Qt DLLs with ARM64 versions..."
if exist "%QT_BIN_DIR:"=%\Qt6Core.dll" (
echo "Copying all ARM64 Qt DLLs from %QT_BIN_DIR:"=%"
copy "%QT_BIN_DIR:"=%\*.dll" "%OUT_APP_DIR:"=%\" /y >nul 2>&1
REM Also copy DLLs from Qt root directory (d3dcompiler_47.dll, dxcompiler.dll, etc.)
set "QT_ROOT=%QT_BIN_DIR:"=%\.."
if exist "%QT_ROOT%\*.dll" (
echo "Copying additional ARM64 DLLs from Qt root"
copy "%QT_ROOT%\*.dll" "%OUT_APP_DIR:"=%\" /y >nul 2>&1
)
REM Copy all ARM64 Qt plugins (overwrite x64 versions)
if exist "%QT_BIN_DIR:"=%\..\plugins" (
echo "Copying ARM64 Qt plugins"
xcopy "%QT_BIN_DIR:"=%\..\plugins" "%OUT_APP_DIR:"=%\" /s /e /y /i >nul 2>&1
)
REM Copy ARM64 QML modules
if exist "%QT_BIN_DIR:"=%\..\qml" (
echo "Copying ARM64 QML modules"
xcopy "%QT_BIN_DIR:"=%\..\qml" "%OUT_APP_DIR:"=%\qml\" /s /e /y /i >nul 2>&1
)
REM Copy translations
if exist "%QT_BIN_DIR:"=%\..\translations" (
echo "Copying translations"
xcopy "%QT_BIN_DIR:"=%\..\translations" "%OUT_APP_DIR:"=%\translations\" /s /e /y /i >nul 2>&1
)
REM Copy resources
if exist "%QT_BIN_DIR:"=%\..\resources" (
echo "Copying resources"
xcopy "%QT_BIN_DIR:"=%\..\resources" "%OUT_APP_DIR:"=%\resources\" /s /e /y /i >nul 2>&1
)
REM Copy all additional Qt module directories that exist
echo "Copying additional ARM64 Qt module directories..."
set "QT_ROOT=%QT_BIN_DIR:"=%\.."
REM List of Qt module directories to copy
for %%d in (cloak cygwin generic iconengines imageformats networkinformation openvpn platforms qmltooling ss styles tap tls xray) do (
if exist "%QT_ROOT%\%%d" (
echo "Copying %%d directory"
xcopy "%QT_ROOT%\%%d" "%OUT_APP_DIR:"=%\%%d\" /s /e /y /i >nul 2>&1
)
)
echo "ARM64 Qt libraries copied successfully"
REM Remove ALL debug DLLs recursively (Qt6*d.dll, *d.dll in all subdirectories)
echo "Removing debug DLLs and libraries from output directory (recursive)..."
del /s /q "%OUT_APP_DIR:"=%\*d.dll" >nul 2>&1
) else (
echo "ERROR: ARM64 Qt DLLs not found in %QT_BIN_DIR:"=%"
exit /b 1
)
) else (
"%QT_BIN_DIR:"=%\windeployqt" --release --qmldir "%PROJECT_DIR:"=%\client" --force --no-translations "%OUT_APP_DIR:"=%\%APP_FILENAME:"=%"
)
signtool sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 *.dll
REM Sign DLLs - use x64 signtool for ARM64 cross-compilation
cd %OUT_APP_DIR%
if defined QT_HOST_BIN_DIR (
if defined SIGNGTOOL_PATH (
"%SIGNGTOOL_PATH%" sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 *.dll
) else (
echo "Warning: Could not find x64 signtool, trying default signtool for DLLs"
signtool sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 *.dll 2>nul || echo "Warning: DLL signing failed, continuing..."
)
) else (
signtool sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 *.dll
)
echo "Copying deploy data..."
xcopy %DEPLOY_DATA_DIR% %OUT_APP_DIR% /s /e /y /i /f
@@ -87,7 +259,17 @@ echo "Creating installer..."
timeout 5
cd %PROJECT_DIR%
signtool sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 "%TARGET_FILENAME%"
REM For ARM64 cross-compilation, use x64 signtool for final installer
if defined QT_HOST_BIN_DIR (
if defined SIGNGTOOL_PATH (
"%SIGNGTOOL_PATH%" sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 "%TARGET_FILENAME%"
) else (
echo "Warning: Could not find x64 signtool, trying default signtool for installer"
signtool sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 "%TARGET_FILENAME%" 2>nul || echo "Warning: Installer signing failed, continuing..."
)
) else (
signtool sign /v /n "Privacy Technologies OU" /fd sha256 /tr http://timestamp.comodoca.com/?td=sha256 /td sha256 "%TARGET_FILENAME%"
)
echo "Finished, see %TARGET_FILENAME%"
exit 0

View File

@@ -0,0 +1,6 @@
sc stop AmneziaWGTunnel$AmneziaVPN
sc delete AmneziaWGTunnel$AmneziaVPN
taskkill /IM "AmneziaVPN-service.exe" /F
taskkill /IM "AmneziaVPN.exe" /F
exit /b 0

View File

@@ -0,0 +1,33 @@
set AmneziaPath=%~dp0
echo %AmneziaPath%
rem Define directories for logs
set "ORG_DIR=%AppData%\AmneziaVPN.ORG"
set "USER_APP_DIR=%ORG_DIR%\AmneziaVPN"
set "USER_LOG_DIR=%USER_APP_DIR%\log"
set "SYS_APP_DIR=%ProgramData%\AmneziaVPN"
set "SYS_LOG_DIR=%SYS_APP_DIR%\log"
set "SYS_LOG_FILE=%SYS_LOG_DIR%\AmneziaVPN-service.log"
timeout /t 1
sc stop AmneziaVPN-service
sc delete AmneziaVPN-service
sc stop AmneziaWGTunnel$AmneziaVPN
sc delete AmneziaWGTunnel$AmneziaVPN
taskkill /IM "AmneziaVPN-service.exe" /F
taskkill /IM "AmneziaVPN.exe" /F
rem Delete the service log file under ProgramData
if exist "%SYS_LOG_FILE%" del /F /Q "%SYS_LOG_FILE%"
if exist "%SYS_LOG_DIR%" rmdir /S /Q "%SYS_LOG_DIR%"
rem Try to remove application dir if empty
rd "%SYS_APP_DIR%" 2>nul
rem Delete client logs under current user's AppData\Roaming (Organization\Application)
if exist "%USER_LOG_DIR%" rmdir /S /Q "%USER_LOG_DIR%"
rem Try to remove app and org directories if empty
rd "%USER_APP_DIR%" 2>nul
rd "%ORG_DIR%" 2>nul
exit /b 0

View File

@@ -73,12 +73,36 @@ Component.prototype.createOperations = function()
"workingDirectory=@TargetDir@", "iconPath=@TargetDir@\\" + appExecutableFileName(), "iconId=0");
if (!vcRuntimeIsInstalled()) {
if (systemInfo.currentCpuArchitecture.search("64") < 0) {
var targetDir = installer.value("TargetDir").replace(/\//g, '\\');
var vcRedistArm64 = installer.findPath("vc_redist.arm64.exe", [targetDir]);
var vcRedistX86 = installer.findPath("vc_redist.x86.exe", [targetDir]);
var vcRedistX64 = installer.findPath("vc_redist.x64.exe", [targetDir]);
if (vcRedistArm64.length > 0) {
console.log("Found vc_redist.arm64.exe, installing ARM64 redistributable");
component.addElevatedOperation("Execute", "@TargetDir@\\" + "vc_redist.arm64.exe", "/install", "/quiet", "/norestart", "/log", "vc_redist.log");
}
else if (vcRedistX86.length > 0) {
console.log("Found vc_redist.x86.exe, installing x86 redistributable");
component.addElevatedOperation("Execute", "@TargetDir@\\" + "vc_redist.x86.exe", "/install", "/quiet", "/norestart", "/log", "vc_redist.log");
}
else {
else if (vcRedistX64.length > 0) {
console.log("Found vc_redist.x64.exe, installing x64 redistributable");
component.addElevatedOperation("Execute", "@TargetDir@\\" + "vc_redist.x64.exe", "/install", "/quiet", "/norestart", "/log", "vc_redist.log");
}
else {
// Fallback to system architecture detection
console.log("No vc_redist file found, using system architecture: " + systemInfo.currentCpuArchitecture);
if (systemInfo.currentCpuArchitecture.search("arm64") >= 0) {
component.addElevatedOperation("Execute", "@TargetDir@\\" + "vc_redist.arm64.exe", "/install", "/quiet", "/norestart", "/log", "vc_redist.log");
}
else if (systemInfo.currentCpuArchitecture.search("64") < 0) {
component.addElevatedOperation("Execute", "@TargetDir@\\" + "vc_redist.x86.exe", "/install", "/quiet", "/norestart", "/log", "vc_redist.log");
}
else {
component.addElevatedOperation("Execute", "@TargetDir@\\" + "vc_redist.x64.exe", "/install", "/quiet", "/norestart", "/log", "vc_redist.log");
}
}
} else {
console.log("Microsoft Visual C++ 2017 Redistributable already installed");

View File

@@ -18,22 +18,21 @@ set(QSIMPLECRYPTO_DIR ${CMAKE_CURRENT_LIST_DIR}/../../client/3rd/QSimpleCrypto/s
set(OPENSSL_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}/../../client/3rd-prebuilt/3rd-prebuilt/openssl/")
set(OPENSSL_LIBRARIES_DIR "${OPENSSL_ROOT_DIR}/lib")
set(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/windows/include")
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
set(OPENSSL_LIB_SSL_PATH "${OPENSSL_ROOT_DIR}/windows/win64/libssl.lib")
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/windows/win64/libcrypto.lib")
else()
set(OPENSSL_LIB_SSL_PATH "${OPENSSL_ROOT_DIR}/windows/win32/libssl.lib")
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/windows/win32/libcrypto.lib")
endif()
if(WIN32)
set(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/windows/include")
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
# Use CMAKE_GENERATOR_PLATFORM for cross-compilation detection (ARM64 on x64 host)
if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "ARM64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ARM64")
set(OPENSSL_LIB_SSL_PATH "${OPENSSL_ROOT_DIR}/windows/winarm64/libssl.lib")
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/windows/winarm64/libcrypto.lib")
message(STATUS "Service: Using ARM64 OpenSSL libraries")
elseif("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
set(OPENSSL_LIB_SSL_PATH "${OPENSSL_ROOT_DIR}/windows/win64/libssl.lib")
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/windows/win64/libcrypto.lib")
message(STATUS "Service: Using x64 OpenSSL libraries")
else()
set(OPENSSL_LIB_SSL_PATH "${OPENSSL_ROOT_DIR}/windows/win32/libssl.lib")
set(OPENSSL_LIB_CRYPTO_PATH "${OPENSSL_ROOT_DIR}/windows/win32/libcrypto.lib")
message(STATUS "Service: Using x86 OpenSSL libraries")
endif()
elseif(APPLE AND NOT IOS)
set(OPENSSL_INCLUDE_DIR "${OPENSSL_ROOT_DIR}/macos/include")
@@ -360,7 +359,10 @@ qt_add_repc_sources(${PROJECT} ${CMAKE_CURRENT_LIST_DIR}/../../ipc/ipc_process_t
# copy deploy artifacts required to run the application to the debug build folder
if(WIN32)
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
# Use CMAKE_GENERATOR_PLATFORM for cross-compilation detection
if("${CMAKE_GENERATOR_PLATFORM}" STREQUAL "ARM64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "ARM64")
set(DEPLOY_PLATFORM_PATH "windows/arm64")
elseif("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
set(DEPLOY_PLATFORM_PATH "windows/x64")
else()
set(DEPLOY_PLATFORM_PATH "windows/x32")

View File

@@ -4,6 +4,7 @@
#include <QRegularExpressionMatchIterator>
#include <QCoreApplication>
#include <QOperatingSystemVersion>
#include <QSysInfo>
#include "tapcontroller_win.h"
@@ -266,6 +267,12 @@ QString TapController::getOpenVpnPath()
QString TapController::getTapDriverDir()
{
// For ARM64 architecture, use the arm64-specific tap driver directory
QString cpuArch = QSysInfo::currentCpuArchitecture();
if (cpuArch == "arm64" || cpuArch == "arm64-little-endian") {
return qApp->applicationDirPath() + "\\tap\\arm64";
}
if (oldDriversRequired()) {
return qApp->applicationDirPath() + "\\tap\\windows_7";
}