summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md1
m---------dist-assets/binaries0
-rw-r--r--dist-assets/windows/installer.nsh92
3 files changed, 93 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2e76af08b6..ddfc07076b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -44,6 +44,7 @@ Line wrap the file at 100 chars. Th
- Install the OpenVPN certificate to avoid the TAP adapter driver installation warning on
Windows 8 and newer.
- Remove Mullvad TAP adapter on uninstall. Also remove the TAP driver if there are no other TAP adapters in the system.
+- Install Wintun driver that provides the WireGuard TUN adapter.
### Changed
#### Windows
diff --git a/dist-assets/binaries b/dist-assets/binaries
-Subproject 85f5f891ca36ff6e55d5fa22d685694726a61d1
+Subproject 08489a83dbd30e466b9603fe5689c3028b08617
diff --git a/dist-assets/windows/installer.nsh b/dist-assets/windows/installer.nsh
index 4f92961f7f..56cb1269ba 100644
--- a/dist-assets/windows/installer.nsh
+++ b/dist-assets/windows/installer.nsh
@@ -100,6 +100,20 @@
!define ExtractDriver '!insertmacro "ExtractDriver"'
#
+# ExtractWintun
+#
+# Extract Wintun installer into $TEMP
+#
+!macro ExtractWintun
+
+ SetOutPath "$TEMP"
+ File "${BUILD_RESOURCES_DIR}\binaries\x86_64-pc-windows-msvc\wintun\mullvad-wintun-amd64.msi"
+
+!macroend
+
+!define ExtractWintun '!insertmacro "ExtractWintun"'
+
+#
# ForceRenameAdapter
#
# For when there's a broken TAP adapter present, such that the adapter name
@@ -373,6 +387,71 @@
!define InstallDriver '!insertmacro "InstallDriver"'
#
+# RemoveWintun
+#
+# Try to remove Wintun
+#
+!macro RemoveWintun
+ Push $0
+
+ log::Log "RemoveWintun()"
+
+ ${DisableX64FSRedirection}
+ ExecWait '"$SYSDIR\msiexec.exe" /x "$TEMP\mullvad-wintun-amd64.msi" /qn /norestart' $0
+ ${EnableX64FSRedirection}
+
+ ${If} $0 != 0
+ log::Log "Failed to remove Wintun: error $0"
+ Goto RemoveWintun_return_only
+ ${EndIf}
+
+ log::Log "RemoveWintun() completed successfully"
+
+ RemoveWintun_return_only:
+
+ Pop $0
+
+!macroend
+
+!define RemoveWintun '!insertmacro "RemoveWintun"'
+
+#
+# InstallWintun
+#
+# Install Wintun driver
+#
+# Returns: 0 in $R0 on success, otherwise an error message in $R0
+#
+!macro InstallWintun
+
+ log::Log "InstallWintun()"
+
+ Push $0
+
+ ${DisableX64FSRedirection}
+ ExecWait '"$SYSDIR\msiexec.exe" /i "$TEMP\mullvad-wintun-amd64.msi" /qn /norestart' $0
+ ${EnableX64FSRedirection}
+
+ ${If} $0 != 0
+ StrCpy $R0 "Failed to install Wintun: error $0"
+ log::Log $R0
+ Goto InstallWintun_return
+ ${EndIf}
+
+ log::Log "InstallWintun() completed successfully"
+
+ Push 0
+ Pop $R0
+
+ InstallWintun_return:
+
+ Pop $0
+
+!macroend
+
+!define InstallWintun '!insertmacro "InstallWintun"'
+
+#
# InstallService
#
# Register the service with Windows and start it
@@ -684,6 +763,15 @@
Abort
${EndIf}
+ ${ExtractWintun}
+ ${InstallWintun}
+
+ ${If} $R0 != 0
+ MessageBox MB_OK "Fatal error during Wintun installation: $R0"
+ ${BreakInstallation}
+ Abort
+ ${EndIf}
+
${InstallService}
${If} $R0 != 0
@@ -751,6 +839,10 @@
# If not ran silently
${If} $FullUninstall == 1
+ # Remove Wintun
+ ${ExtractWintun}
+ ${RemoveWintun}
+
# Remove the TAP adapter
${ExtractDriver}
${RemoveTap}