diff --git a/README.md b/README.md index b722962..d4e1820 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/desktop-client/package.json b/desktop-client/package.json index 5c3ec80..8ac206c 100644 --- a/desktop-client/package.json +++ b/desktop-client/package.json @@ -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", diff --git a/desktop-client/scripts/build-tunnel-helper.sh b/desktop-client/scripts/build-tunnel-helper.sh index 3fb6b87..00e7f09 100644 --- a/desktop-client/scripts/build-tunnel-helper.sh +++ b/desktop-client/scripts/build-tunnel-helper.sh @@ -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 diff --git a/desktop-client/src-tauri/bundled/windows-x64/README.txt b/desktop-client/src-tauri/bundled/windows-x64/README.txt new file mode 100644 index 0000000..d75a73d --- /dev/null +++ b/desktop-client/src-tauri/bundled/windows-x64/README.txt @@ -0,0 +1 @@ +Bundle the Windows x64 NexaVPN tunnel helper here. diff --git a/desktop-client/src-tauri/src/tunnel_manager.rs b/desktop-client/src-tauri/src/tunnel_manager.rs index 6073c05..0b267d9 100644 --- a/desktop-client/src-tauri/src/tunnel_manager.rs +++ b/desktop-client/src-tauri/src/tunnel_manager.rs @@ -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 { .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); diff --git a/docs/client-platforms.md b/docs/client-platforms.md index 0d83a96..ef499f5 100644 --- a/docs/client-platforms.md +++ b/docs/client-platforms.md @@ -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