feat: win arm64 add support vc_redist

This commit is contained in:
NickVs2015
2025-11-28 21:25:47 +03:00
parent 0945997b34
commit cf9196777c
3 changed files with 42 additions and 8 deletions

View File

@@ -169,6 +169,7 @@ jobs:
# ------------------------------------------------------
Build-Windows-ARM64:
needs: Build-Windows
runs-on: windows-latest
env:
@@ -215,11 +216,11 @@ jobs:
- name: 'Setup ccache'
uses: hendrikmuhs/ccache-action@v1.2
- name: 'List available Qt architectures'
- name: 'Cleanup Qt directory'
shell: bash
run: |
pip install aqtinstall
python -m aqt list-qt windows desktop --arch ${{ env.QT_VERSION }}
rm -rf "${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/msvc2022_64"
rm -rf "${{ runner.temp }}/Qt/${{ env.QT_VERSION }}/win64_msvc2022_arm64_cross_compiled"
- name: 'Install Qt Desktop (host for cross-compilation)'
uses: jurplel/install-qt-action@v3
@@ -259,6 +260,7 @@ jobs:
set BUILD_ARCH=${{ env.BUILD_ARCH }}
set QT_BIN_DIR="${{ runner.temp }}\\Qt\\${{ env.QT_VERSION }}\\win64_msvc2022_arm64_cross_compiled\\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

View File

@@ -51,7 +51,11 @@ del %TARGET_FILENAME%
mkdir %WORK_DIR%
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
cd %PROJECT_DIR%
@@ -76,7 +80,13 @@ 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
"%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
if defined QT_HOST_BIN_DIR (
echo "Using host windeployqt for cross-compilation"
"%QT_HOST_BIN_DIR:"=%\windeployqt" --release --qmldir "%PROJECT_DIR:"=%\client" --force --no-translations --compiler-runtime "%OUT_APP_DIR:"=%\%APP_FILENAME:"=%"
) 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

View File

@@ -73,15 +73,37 @@ Component.prototype.createOperations = function()
"workingDirectory=@TargetDir@", "iconPath=@TargetDir@\\" + appExecutableFileName(), "iconId=0");
if (!vcRuntimeIsInstalled()) {
if (systemInfo.currentCpuArchitecture.search("arm64") >= 0) {
// Check for vc_redist files in target directory to determine architecture
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 (systemInfo.currentCpuArchitecture.search("64") < 0) {
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");