refactor: migrate Windows target from x86 to x64 architecture
Update all Windows build configurations, scripts, and documentation from i686-pc-windows-msvc (x86) to x86_64-pc-windows-msvc (x64). Update npm scripts, build-tunnel-helper.sh target validation, bundled helper paths, and tunnel manager strategy references. Add XWIN_ARCH=x86_64 environment variable to Linux cross-build command and --xwin-arch flag to cargo xwin invocation.
This commit is contained in:
@@ -8,9 +8,9 @@
|
||||
"build": "tsc -b && vite build",
|
||||
"tauri:dev": "tauri dev",
|
||||
"tauri:build": "tauri build",
|
||||
"helper:windows-x86": "bash ./scripts/build-tunnel-helper.sh i686-pc-windows-msvc",
|
||||
"helper:windows-x64": "bash ./scripts/build-tunnel-helper.sh x86_64-pc-windows-msvc",
|
||||
"helper:macos-arm64": "bash ./scripts/build-tunnel-helper.sh aarch64-apple-darwin",
|
||||
"tauri:build:windows-x86:linux": "tauri build --runner cargo-xwin --target i686-pc-windows-msvc --config src-tauri/tauri.windows.conf.json"
|
||||
"tauri:build:windows-x64:linux": "XWIN_ARCH=x86_64 tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc --config src-tauri/tauri.windows.conf.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tauri-apps/api": "^2.3.0",
|
||||
|
||||
@@ -13,8 +13,8 @@ if [ -z "${TARGET}" ]; then
|
||||
fi
|
||||
|
||||
case "${TARGET}" in
|
||||
i686-pc-windows-msvc)
|
||||
OUTPUT_DIR="${BUNDLED_DIR}/windows-x86"
|
||||
x86_64-pc-windows-msvc)
|
||||
OUTPUT_DIR="${BUNDLED_DIR}/windows-x64"
|
||||
OUTPUT_NAME="nexavpn-tunnel-helper.exe"
|
||||
;;
|
||||
aarch64-apple-darwin)
|
||||
@@ -27,7 +27,7 @@ case "${TARGET}" in
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ "${TARGET}" = "i686-pc-windows-msvc" ]; then
|
||||
if [ "${TARGET}" = "x86_64-pc-windows-msvc" ]; then
|
||||
case "${HOST_OS}" in
|
||||
MINGW64_NT*|MSYS_NT*|CYGWIN_NT*)
|
||||
;;
|
||||
@@ -40,10 +40,10 @@ if [ "${TARGET}" = "i686-pc-windows-msvc" ]; then
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
echo "Windows x86 helper builds are supported on Windows or on Linux with cargo-xwin."
|
||||
echo "Windows x64 helper builds are supported on Windows or on Linux with cargo-xwin."
|
||||
echo "Current host: ${HOST_OS}"
|
||||
echo "Install the target with:"
|
||||
echo " rustup target add i686-pc-windows-msvc"
|
||||
echo " rustup target add x86_64-pc-windows-msvc"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
@@ -70,8 +70,8 @@ if ! rustup target list --installed | grep -qx "${TARGET}"; then
|
||||
fi
|
||||
|
||||
mkdir -p "${OUTPUT_DIR}"
|
||||
if [ "${HOST_OS}" = "Linux" ] && [ "${TARGET}" = "i686-pc-windows-msvc" ]; then
|
||||
cargo xwin build --manifest-path "${HELPER_DIR}/Cargo.toml" --release --target "${TARGET}"
|
||||
if [ "${HOST_OS}" = "Linux" ] && [ "${TARGET}" = "x86_64-pc-windows-msvc" ]; then
|
||||
cargo xwin build --manifest-path "${HELPER_DIR}/Cargo.toml" --release --target "${TARGET}" --xwin-arch x86_64
|
||||
else
|
||||
cargo build --manifest-path "${HELPER_DIR}/Cargo.toml" --release --target "${TARGET}"
|
||||
fi
|
||||
|
||||
1
desktop-client/src-tauri/bundled/windows-x64/README.txt
Normal file
1
desktop-client/src-tauri/bundled/windows-x64/README.txt
Normal file
@@ -0,0 +1 @@
|
||||
Bundle the Windows x64 NexaVPN tunnel helper here.
|
||||
@@ -7,7 +7,7 @@ use tauri::{AppHandle, Manager};
|
||||
|
||||
pub fn current_tunnel_strategy() -> &'static str {
|
||||
if cfg!(target_os = "windows") {
|
||||
"embedded-wireguard-windows-x86"
|
||||
"embedded-wireguard-windows-x64"
|
||||
} else if cfg!(target_os = "macos") {
|
||||
"embedded-wireguard-macos-arm"
|
||||
} else {
|
||||
@@ -54,11 +54,11 @@ fn bundled_backend(app: &AppHandle) -> Result<PathBuf, String> {
|
||||
.map_err(|err| format!("Unable to resolve resource dir: {}", err))?;
|
||||
|
||||
let relative = if cfg!(target_os = "windows") {
|
||||
PathBuf::from("bundled/windows-x86/nexavpn-tunnel-helper.exe")
|
||||
PathBuf::from("bundled/windows-x64/nexavpn-tunnel-helper.exe")
|
||||
} else if cfg!(target_os = "macos") {
|
||||
PathBuf::from("bundled/macos-arm64/nexavpn-tunnel-helper")
|
||||
} else {
|
||||
return Err("This NexaVPN client build supports embedded tunnel backends only for Windows x86 and macOS ARM".into());
|
||||
return Err("This NexaVPN client build supports embedded tunnel backends only for Windows x64 and macOS ARM".into());
|
||||
};
|
||||
|
||||
let path = resource_dir.join(relative);
|
||||
|
||||
Reference in New Issue
Block a user