summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2020-09-29 13:26:24 +0200
committerDavid Lönnhager <david.l@mullvad.net>2020-11-24 18:50:04 +0100
commitaf6a5af32e2363b75bfb1e58a5f3e8ea380dccf9 (patch)
tree8e10a586c6efffd016168258d0a0383f083d0fd2
parent5fc78d71faf464e395078246ab4733c338067ba6 (diff)
downloadmullvadvpn-af6a5af32e2363b75bfb1e58a5f3e8ea380dccf9.tar.xz
mullvadvpn-af6a5af32e2363b75bfb1e58a5f3e8ea380dccf9.zip
Remove TAP driver from installer
-rw-r--r--dist-assets/windows/installer.nsh167
1 files changed, 4 insertions, 163 deletions
diff --git a/dist-assets/windows/installer.nsh b/dist-assets/windows/installer.nsh
index f231f36912..de95747cdf 100644
--- a/dist-assets/windows/installer.nsh
+++ b/dist-assets/windows/installer.nsh
@@ -12,9 +12,6 @@
# Do not compare variables using the <> operator - broken
#
-# TAP device hardware ID
-!define TAP_HARDWARE_ID "tapmullvad0901"
-
# Wintun hardware ID
!define TUN_HARDWARE_ID "wintun"
@@ -51,31 +48,6 @@
!define PERSISTENT_BLOCK_OUTBOUND_IPV4_FILTER_GUID "{79860c64-9a5e-48a3-b5f3-d64b41659aa5}"
#
-# ExtractTapDriver
-#
-# Extract the correct driver for the current platform
-# placing it into $TEMP\tap-driver
-#
-!macro ExtractTapDriver
-
- SetOutPath "$TEMP\tap-driver"
-
- File "${BUILD_RESOURCES_DIR}\..\windows\driverlogic\bin\x64-Release\driverlogic.exe"
- File "${BUILD_RESOURCES_DIR}\binaries\x86_64-pc-windows-msvc\tap-driver\*"
-
- ${If} ${AtLeastWin10}
- File "${BUILD_RESOURCES_DIR}\binaries\x86_64-pc-windows-msvc\tap-driver\win10\*"
- ${ElseIf} ${AtLeastWin8}
- File "${BUILD_RESOURCES_DIR}\binaries\x86_64-pc-windows-msvc\tap-driver\win8\*"
- ${Else}
- File "${BUILD_RESOURCES_DIR}\binaries\x86_64-pc-windows-msvc\tap-driver\win7\*"
- ${EndIf}
-
-!macroend
-
-!define ExtractTapDriver '!insertmacro "ExtractTapDriver"'
-
-#
# ExtractWintun
#
# Extract Wintun installer into $TEMP
@@ -84,6 +56,7 @@
SetOutPath "$TEMP"
File "${BUILD_RESOURCES_DIR}\binaries\x86_64-pc-windows-msvc\mullvad-wintun-amd64.msi"
+ File "${BUILD_RESOURCES_DIR}\..\windows\driverlogic\bin\x64-Release\driverlogic.exe"
!macroend
@@ -105,127 +78,6 @@
!define ExtractMullvadSetup '!insertmacro "ExtractMullvadSetup"'
#
-# RemoveBrandedTap
-#
-# Try to remove the Mullvad TAP adapter driver
-#
-!macro RemoveBrandedTap
- Push $0
- Push $1
-
- nsExec::ExecToStack '"$TEMP\tap-driver\driverlogic.exe" remove ${TAP_HARDWARE_ID}'
- Pop $0
- Pop $1
-
- Pop $1
- Pop $0
-
-!macroend
-
-!define RemoveBrandedTap '!insertmacro "RemoveBrandedTap"'
-
-#
-# RemoveVanillaTap
-#
-# Try to remove the old Mullvad TAP adapter (with a non-unique hardware ID),
-# and uninstall the driver if it's not in use.
-#
-!macro RemoveVanillaTap
- Push $0
- Push $1
-
- log::Log "RemoveVanillaTap()"
-
- nsExec::ExecToStack '"$TEMP\tap-driver\driverlogic.exe" remove-vanilla-tap'
-
- Pop $0
- Pop $1
-
- ${If} $0 != ${DL_GENERAL_SUCCESS}
- IntFmt $0 "0x%X" $0
- StrCpy $R0 "Failed to remove vanilla TAP adapter: error $0"
- log::LogWithDetails $R0 $1
-
- Goto RemoveVanillaTap_return
- ${EndIf}
-
- log::Log "RemoveVanillaTap() completed successfully"
-
- RemoveVanillaTap_return:
-
- Push 0
- Pop $R0
-
- Pop $1
- Pop $0
-
-!macroend
-
-!define RemoveVanillaTap '!insertmacro "RemoveVanillaTap"'
-
-#
-# InstallTapDriver
-#
-# Install OpenVPN TAP adapter driver
-#
-# Returns: 0 in $R0 on success, otherwise an error message in $R0
-#
-!macro InstallTapDriver
-
- log::Log "InstallTapDriver()"
-
- Push $0
- Push $1
-
- #
- # Remove the old-ID Mullvad TAP, if it exists
- #
- ${RemoveVanillaTap}
-
- #
- # Silently approve the certificate before installing the driver
- #
- ${IfNot} ${AtLeastWin10}
- log::Log "Adding OpenVPN certificate to the certificate store"
-
- nsExec::ExecToStack '"$SYSDIR\certutil.exe" -f -addstore TrustedPublisher "$TEMP\tap-driver\driver.cer"'
- Pop $0
- Pop $1
-
- ${If} $0 != 0
- StrCpy $R0 "Failed to add trusted publisher certificate: error $0"
- log::LogWithDetails $R0 $1
- ${EndIf}
- ${EndIf}
-
- log::Log "Creating new virtual adapter"
- nsExec::ExecToStack '"$TEMP\tap-driver\driverlogic.exe" install "$TEMP\tap-driver\OemVista.inf"'
-
- Pop $0
- Pop $1
-
- ${If} $0 != ${DL_GENERAL_SUCCESS}
- IntFmt $0 "0x%X" $0
- StrCpy $R0 "Failed to create virtual adapter: error $0"
- log::LogWithDetails $R0 $1
- Goto InstallTapDriver_return
- ${EndIf}
-
- log::Log "InstallTapDriver() completed successfully"
-
- Push 0
- Pop $R0
-
- InstallTapDriver_return:
-
- Pop $1
- Pop $0
-
-!macroend
-
-!define InstallTapDriver '!insertmacro "InstallTapDriver"'
-
-#
# RemoveWintun
#
# Try to remove Wintun
@@ -236,7 +88,7 @@
log::Log "RemoveWintun()"
- nsExec::ExecToStack '"$TEMP\tap-driver\driverlogic.exe" remove-device ${TUN_HARDWARE_ID} Mullvad-WT'
+ nsExec::ExecToStack '"$TEMP\driverlogic.exe" remove-device ${TUN_HARDWARE_ID} Mullvad'
Pop $0
Pop $1
@@ -289,7 +141,8 @@
${EndIf}
log::Log "Creating new virtual adapter"
- nsExec::ExecToStack '"$TEMP\tap-driver\driverlogic.exe" new-device ${TUN_HARDWARE_ID} Mullvad-WT'
+ nsExec::ExecToStack '"$TEMP\driverlogic.exe" new-device ${TUN_HARDWARE_ID} Mullvad'
+
Pop $0
Pop $1
@@ -765,14 +618,6 @@
${RemoveRelayCache}
${RemoveApiAddressCache}
- ${ExtractTapDriver}
- ${InstallTapDriver}
-
- ${If} $R0 != 0
- MessageBox MB_OK "Fatal error during driver installation: $R0"
- Goto customInstall_abort_installation
- ${EndIf}
-
${ExtractWintun}
${InstallWintun}
@@ -909,10 +754,6 @@
${RemoveCLIFromEnvironPath}
- # Remove the TAP adapter
- ${ExtractTapDriver}
- ${RemoveBrandedTap}
-
${If} $FullUninstall == 1
${ClearFirewallRules}
${ClearAccountHistory}