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:
2026-03-17 19:13:56 +01:00
parent 8d8a3a7859
commit 991df88d58
6 changed files with 24 additions and 21 deletions

View File

@@ -46,7 +46,7 @@ This repository contains the initial production-minded MVP scaffold:
## Desktop Requirements
- Windows x86: package NexaVPN with the bundled Windows x86 tunnel helper
- Windows x64: package NexaVPN with the bundled Windows x64 tunnel helper
- macOS ARM: package NexaVPN with the bundled macOS ARM tunnel helper
See [client-platforms.md](/mnt/c/Users/neste/Documents/GIT/NexaVPN/docs/client-platforms.md) for the current platform strategy.
@@ -55,7 +55,7 @@ Helper build commands:
```bash
cd desktop-client
npm run helper:windows-x86
npm run helper:windows-x64
npm run helper:macos-arm64
```
@@ -64,17 +64,19 @@ Ubuntu-to-Windows `Setup.exe` build:
```bash
cd desktop-client
cargo install --locked cargo-xwin
rustup target add i686-pc-windows-msvc
rustup target add x86_64-pc-windows-msvc
npm install
npm run helper:windows-x86
npm run tauri:build:windows-x86:linux
npm run helper:windows-x64
npm run tauri:build:windows-x64:linux
```
The resulting NSIS installer is written to:
- `desktop-client/src-tauri/target/i686-pc-windows-msvc/release/bundle/nsis/`
- `desktop-client/src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/`
This Linux cross-build path is intended for NSIS `Setup.exe` output. Native MSI packaging and final Windows code signing should still be done on Windows.
For `x86_64-pc-windows-msvc`, the build uses the Windows `x86_64` SDK/CRT set via `cargo-xwin`.
Gateway utility scripts:

View File

@@ -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",

View File

@@ -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

View File

@@ -0,0 +1 @@
Bundle the Windows x64 NexaVPN tunnel helper here.

View File

@@ -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);

View File

@@ -1,19 +1,19 @@
# Desktop Platform Strategy
## Windows x86
## Windows x64
Current MVP integration path:
- NexaVPN enrolls the device and stores the generated profile locally.
- NexaVPN is intended to ship its own bundled Windows x86 tunnel helper.
- NexaVPN is intended to ship its own bundled Windows x64 tunnel helper.
- The end user should interact only with NexaVPN.
- The bundled helper encapsulates the WireGuard runtime internally.
Repository status:
- the NexaVPN tunnel helper CLI is now included in `desktop-client/tunnel-helper/`
- the Windows x86 build can be bundled into `src-tauri/bundled/windows-x86/`
- Ubuntu server builds can cross-compile the Windows x86 helper and Tauri app with `cargo-xwin`
- the Windows x64 build can be bundled into `src-tauri/bundled/windows-x64/`
- Ubuntu server builds can cross-compile the Windows x64 helper and Tauri app with `cargo-xwin`
- the Linux-based Windows packaging path targets NSIS `Setup.exe`; MSI packaging still requires a Windows environment
## macOS ARM