diff options
| author | David Lönnhager <david.l@mullvad.net> | 2019-11-26 12:39:59 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2019-11-26 12:39:59 +0100 |
| commit | 5da52fa32fef57959968c4f631d804414e058a4e (patch) | |
| tree | cf979da9f08f985480768568682b2b91c7cdee4e | |
| parent | 81c4801cb8c42b7a61ca1893fb559faa56a0d7d7 (diff) | |
| parent | 667c6912b0d8cff5976151e95042030ec0f34d79 (diff) | |
| download | mullvadvpn-5da52fa32fef57959968c4f631d804414e058a4e.tar.xz mullvadvpn-5da52fa32fef57959968c4f631d804414e058a4e.zip | |
Merge branch 'installer-fix'
| -rw-r--r-- | dist-assets/windows/installer.nsh | 18 | ||||
| -rw-r--r-- | windows/nsis-plugins/src/driverlogic/context.cpp | 4 |
2 files changed, 16 insertions, 6 deletions
diff --git a/dist-assets/windows/installer.nsh b/dist-assets/windows/installer.nsh index c68a1f6f26..d1bf3b28ed 100644 --- a/dist-assets/windows/installer.nsh +++ b/dist-assets/windows/installer.nsh @@ -50,6 +50,12 @@ !define PE_GENERAL_ERROR 0 !define PE_SUCCESS 1 +# Return codes from tapinstall +!define DEVCON_EXIT_OK 0 +!define DEVCON_EXIT_REBOOT 1 +!define DEVCON_EXIT_FAIL 2 +!define DEVCON_EXIT_USAGE 3 + # Log targets !define LOG_FILE 0 !define LOG_VOID 1 @@ -262,15 +268,15 @@ Pop $0 Pop $1 + Push $0 + Pop $InstallDriver_BaselineStatus + ${If} $0 == ${EB_GENERAL_ERROR} StrCpy $R0 "Failed to enumerate network adapters: $1" log::Log $R0 Goto InstallDriver_return ${EndIf} - Push $0 - Pop $InstallDriver_BaselineStatus - ${IfNot} ${AtLeastWin10} # # Silently approve the certificate before installing the driver @@ -299,7 +305,8 @@ Pop $0 Pop $1 - ${If} $0 != 0 + ${If} $0 != ${DEVCON_EXIT_OK} + ${AndIf} $0 != ${DEVCON_EXIT_REBOOT} StrCpy $R0 "Failed to update TAP driver: error $0" log::LogWithDetails $R0 $1 Goto InstallDriver_return @@ -336,7 +343,8 @@ Pop $0 Pop $1 - ${If} $0 != 0 + ${If} $0 != ${DEVCON_EXIT_OK} + ${AndIf} $0 != ${DEVCON_EXIT_REBOOT} StrCpy $R0 "Failed to create virtual adapter: error $0" log::LogWithDetails $R0 $1 Goto InstallDriver_return diff --git a/windows/nsis-plugins/src/driverlogic/context.cpp b/windows/nsis-plugins/src/driverlogic/context.cpp index 33e66da0ab..42394e25e3 100644 --- a/windows/nsis-plugins/src/driverlogic/context.cpp +++ b/windows/nsis-plugins/src/driverlogic/context.cpp @@ -81,7 +81,8 @@ std::set<Context::NetworkAdapter> GetTapAdapters(const std::set<Context::Network return tapAdapters; } -void LogAdapters(const std::wstring &description, const std::set<Context::NetworkAdapter> &adapters) +template<typename T> +void LogAdapters(const std::wstring &description, const T &adapters) { // // Flatten the information so we can log it more easily. @@ -239,6 +240,7 @@ Context::NetworkAdapter Context::getNewAdapter() if (added.size() != 1) { LogAdapters(L"Enumerable network adapters", m_currentState); + LogAdapters(L"Added TAP adapters", added); throw std::runtime_error("Unable to identify recently added TAP adapter"); } |
