Skip to content

Commit ac6505b

Browse files
committed
Fixed creation of ARM64 installer, added back building Windows modules in build.sh, updated submodules
1 parent a9a596e commit ac6505b

File tree

10 files changed

+79
-27
lines changed

10 files changed

+79
-27
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
/dist-assets/openvpn.exe
2121
/dist-assets/aarch64-apple-darwin/
2222
/dist-assets/x86_64-apple-darwin/
23+
/dist-assets/aarch64-pc-windows-msvc/
2324
/windows/version.h
2425
/windows/**/bin/
2526
/windows/**/*.user

CHANGELOG.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ Line wrap the file at 100 chars. Th
2626
- Add DAITA (Defence against AI-guided Traffic Analysis) setting for Linux and macOS.
2727
- Add `--json` flag to `mullvad status` CLI.
2828

29+
#### Windows
30+
- Add experimental support for Windows ARM64.
31+
2932
### Changed
3033
- Ignore obfuscation protocol constraints when the obfuscation mode is set to auto.
3134

@@ -53,9 +56,6 @@ This release is identical to 2024.4-beta1.
5356
#### macOS
5457
- Add support for split tunneling (beta).
5558

56-
#### Windows
57-
- Add experimental support for Windows ARM64.
58-
5959
### Changed
6060
- Update Electron from 28.1.3 to 30.0.4.
6161

Cargo.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.sh

+26
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,32 @@ function build {
287287
done
288288
}
289289

290+
if [[ "$(uname -s)" == "MINGW"* ]]; then
291+
for t in "${TARGETS[@]:-"x86_64-pc-windows-msvc"}"; do
292+
case $t in
293+
x86_64-pc-windows-msvc) CPP_BUILD_TARGET=x64;;
294+
aarch64-pc-windows-msvc) CPP_BUILD_TARGET=ARM64;;
295+
*)
296+
log_error "Unknown Windows target: $t"
297+
exit 1
298+
;;
299+
esac
300+
301+
log_header "Building C++ code in $CPP_BUILD_MODE mode for $CPP_BUILD_TARGET"
302+
CPP_BUILD_MODES=$CPP_BUILD_MODE CPP_BUILD_TARGETS=$CPP_BUILD_TARGET IS_RELEASE=$IS_RELEASE ./build-windows-modules.sh
303+
304+
if [[ "$SIGN" == "true" ]]; then
305+
CPP_BINARIES=(
306+
"windows/winfw/bin/$CPP_BUILD_TARGET-$CPP_BUILD_MODE/winfw.dll"
307+
"windows/driverlogic/bin/$CPP_BUILD_TARGET-$CPP_BUILD_MODE/driverlogic.exe"
308+
# The nsis plugin is always built in 32 bit release mode
309+
windows/nsis-plugins/bin/Win32-Release/*.dll
310+
)
311+
sign_win "${CPP_BINARIES[@]}"
312+
fi
313+
done
314+
fi
315+
290316
for t in "${TARGETS[@]:-""}"; do
291317
source env.sh "$t"
292318
build "$t"

dist-assets/windows/installer.nsh

+5-4
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
!macro ExtractDriverlogic
8787

8888
SetOutPath "$PLUGINSDIR"
89-
File "${BUILD_RESOURCES_DIR}\..\windows\driverlogic\bin\x64-$%CPP_BUILD_MODE%\driverlogic.exe"
89+
File "${BUILD_RESOURCES_DIR}\..\windows\driverlogic\bin\$%CPP_BUILD_TARGET%-$%CPP_BUILD_MODE%\driverlogic.exe"
9090

9191
!macroend
9292

@@ -100,8 +100,9 @@
100100
!macro ExtractWireGuard
101101

102102
SetOutPath "$PLUGINSDIR"
103+
# No AArch64 wintun, so use x64.
103104
File "${BUILD_RESOURCES_DIR}\binaries\x86_64-pc-windows-msvc\wintun\wintun.dll"
104-
File "${BUILD_RESOURCES_DIR}\binaries\x86_64-pc-windows-msvc\wireguard-nt\mullvad-wireguard.dll"
105+
File "${BUILD_RESOURCES_DIR}\binaries\$%TARGET_TRIPLE%\wireguard-nt\mullvad-wireguard.dll"
105106

106107
!macroend
107108

@@ -115,8 +116,8 @@
115116
!macro ExtractMullvadSetup
116117

117118
SetOutPath "$PLUGINSDIR"
118-
File "${BUILD_RESOURCES_DIR}\mullvad-setup.exe"
119-
File "${BUILD_RESOURCES_DIR}\..\windows\winfw\bin\x64-$%CPP_BUILD_MODE%\winfw.dll"
119+
File "${BUILD_RESOURCES_DIR}\$%SETUP_SUBDIR%\mullvad-setup.exe"
120+
File "${BUILD_RESOURCES_DIR}\..\windows\winfw\bin\$%CPP_BUILD_TARGET%-$%CPP_BUILD_MODE%\winfw.dll"
120121

121122
!macroend
122123

gui/tasks/distribution.js

+31-10
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,18 @@ const config = {
138138
artifactName: 'MullvadVPN-${version}_${arch}.${ext}',
139139
publisherName: 'Mullvad VPN AB',
140140
extraResources: [
141-
{ from: distAssets('mullvad.exe'), to: '.' },
142-
{ from: distAssets('mullvad-problem-report.exe'), to: '.' },
143-
{ from: distAssets('mullvad-daemon.exe'), to: '.' },
144-
{ from: distAssets('talpid_openvpn_plugin.dll'), to: '.' },
141+
{ from: distAssets(path.join(getWindowsDistSubdir(), 'mullvad.exe')), to: '.' },
142+
{ from: distAssets(path.join(getWindowsDistSubdir(), 'mullvad-problem-report.exe')), to: '.' },
143+
{ from: distAssets(path.join(getWindowsDistSubdir(), 'mullvad-daemon.exe')), to: '.' },
144+
{ from: distAssets(path.join(getWindowsDistSubdir(), 'talpid_openvpn_plugin.dll')), to: '.' },
145145
{
146-
from: root(path.join('windows', 'winfw', 'bin', '${env.CPP_BUILD_TARGET}-${env.CPP_BUILD_MODE}', 'winfw.dll')),
146+
from: root(path.join('windows', 'winfw', 'bin', getWindowsTargetArch() + '-${env.CPP_BUILD_MODE}', 'winfw.dll')),
147147
to: '.',
148148
},
149-
{ from: distAssets(path.join('binaries', getWindowsTargetSubdir(), 'openvpn.exe')), to: '.' },
150-
{ from: distAssets(path.join('binaries', getWindowsTargetSubdir(), 'apisocks5.exe')), to: '.' },
151-
{ from: distAssets(path.join('binaries', getWindowsTargetSubdir(), 'wintun/wintun.dll')), to: '.' },
149+
// OpenVPN, APISocks5 and Wintun do not have ARM64 builds yet.
150+
{ from: distAssets(path.join('binaries/x86_64-pc-windows-msvc/openvpn.exe')), to: '.' },
151+
{ from: distAssets(path.join('binaries/x86_64-pc-windows-msvc/apisocks5.exe')), to: '.' },
152+
{ from: distAssets(path.join('binaries/x86_64-pc-windows-msvc/wintun/wintun.dll')), to: '.' },
152153
{
153154
from: distAssets(path.join('binaries', getWindowsTargetSubdir(), 'split-tunnel/mullvad-split-tunnel.sys')),
154155
to: '.'
@@ -254,6 +255,18 @@ function packWin() {
254255
beforeBuild: (options) => {
255256
process.env.CPP_BUILD_MODE = release ? 'Release' : 'Debug';
256257
process.env.CPP_BUILD_TARGET = options.arch;
258+
switch (options.arch) {
259+
case 'x64':
260+
process.env.TARGET_TRIPLE = 'x86_64-pc-windows-msvc';
261+
process.env.SETUP_SUBDIR = '.';
262+
break;
263+
case 'arm64':
264+
process.env.TARGET_TRIPLE = 'aarch64-pc-windows-msvc';
265+
process.env.SETUP_SUBDIR = 'aarch64-pc-windows-msvc';
266+
break;
267+
default:
268+
throw new Error(`Invalid or unknown target (only one may be specified)`);
269+
}
257270
return true;
258271
},
259272
afterAllArtifactBuild: (buildResult) => {
@@ -396,14 +409,22 @@ function root(relativePath) {
396409
return path.join(path.resolve(__dirname, '../../'), relativePath);
397410
}
398411

412+
function getWindowsDistSubdir() {
413+
if (targets === 'aarch64-pc-windows-msvc') {
414+
return targets;
415+
} else {
416+
return '';
417+
}
418+
}
419+
399420
function getWindowsTargetArch() {
400421
if (targets && process.platform === 'win32') {
401422
if (targets === 'aarch64-pc-windows-msvc') {
402423
return 'arm64';
403424
}
404425
throw new Error(`Invalid or unknown target (only one may be specified)`);
405426
}
406-
// Use host architecture.
427+
// Use host architecture (we assume this is x64 since building on Arm64 isn't supported).
407428
return 'x64';
408429
}
409430

@@ -414,7 +435,7 @@ function getWindowsTargetSubdir() {
414435
}
415436
throw new Error(`Invalid or unknown target (only one may be specified)`);
416437
}
417-
// Use host architecture.
438+
// Use host architecture (we assume this is x64 since building on Arm64 isn't supported).
418439
return 'x86_64-pc-windows-msvc';
419440
}
420441

talpid-core/build.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ mod win {
88
manifest_dir().join(build_dir).join(target_platform_dir())
99
}
1010

11-
fn target_platform_dir() -> PathBuf {
12-
let target = env::var("TARGET").expect("TARGET env var not set");
11+
pub fn target() -> String {
12+
env::var("TARGET").expect("TARGET env var not set")
13+
}
1314

15+
fn target_platform_dir() -> PathBuf {
16+
let target = target();
1417
let target_dir = match target.as_str() {
1518
"i686-pc-windows-msvc" => format!("Win32-{}", get_build_mode()),
1619
"x86_64-pc-windows-msvc" => format!("x64-{}", get_build_mode()),
@@ -53,7 +56,7 @@ fn main() {
5356

5457
const WINFW_DIR_VAR: &str = "WINFW_LIB_DIR";
5558
declare_library(WINFW_DIR_VAR, WINFW_BUILD_DIR, "winfw");
56-
let lib_dir = manifest_dir().join("../build/lib/x86_64-pc-windows-msvc");
59+
let lib_dir = manifest_dir().join("../build/lib").join(target());
5760
println!("cargo::rustc-link-search={}", &lib_dir.display());
5861
}
5962

0 commit comments

Comments
 (0)