| 130 | } |
| 131 | |
| 132 | void Uninstaller::RunSecondPhase() |
| 133 | { |
| 134 | spdlog::info(L"Original Uninstall EXE: {}", UninstExeFile); |
| 135 | |
| 136 | if (!InitializeUninstall()) { |
| 137 | spdlog::info(L"return after InitializeUninstall()"); |
| 138 | PostQuitMessage(0); |
| 139 | return; |
| 140 | } |
| 141 | |
| 142 | UninstallHelper(); |
| 143 | |
| 144 | wstring path_for_installation = Path::extractDir(UninstExeFile); |
| 145 | |
| 146 | spdlog::info(L"Running uninstall second phase with path: {}", path_for_installation); |
| 147 | |
| 148 | // Clear any existing auto-login entries. |
| 149 | Registry::regDeleteProperty(HKEY_CURRENT_USER, L"Software\\Windscribe\\Windscribe2", L"username"); |
| 150 | Registry::regDeleteProperty(HKEY_CURRENT_USER, L"Software\\Windscribe\\Windscribe2", L"password"); |
| 151 | |
| 152 | if (!isSilent_) { |
| 153 | spdlog::info(L"turn off firewall: {}", path_for_installation); |
| 154 | Utils::instExec(Path::append(path_for_installation, L"WindscribeService.exe"), L"-firewall_off", INFINITE, SW_HIDE); |
| 155 | } |
| 156 | |
| 157 | spdlog::info(L"uninstall WireGuard service"); |
| 158 | UninstallWireGuardService(); |
| 159 | |
| 160 | const auto taskkillExe = Path::append(Utils::getSystemDir(), L"taskkill.exe"); |
| 161 | |
| 162 | spdlog::info(L"kill openvpn process"); |
| 163 | Utils::instExec(taskkillExe, L"/f /im windscribeopenvpn.exe", INFINITE, SW_HIDE); |
| 164 | |
| 165 | spdlog::info(L"kill wstunnel process"); |
| 166 | Utils::instExec(taskkillExe, L"/f /im windscribewstunnel.exe", INFINITE, SW_HIDE); |
| 167 | |
| 168 | spdlog::info(L"kill ctrld process"); |
| 169 | Utils::instExec(taskkillExe, L"/f /im windscribectrld.exe", INFINITE, SW_HIDE); |
| 170 | |
| 171 | spdlog::info(L"uninstall split tunnel driver"); |
| 172 | UninstallSplitTunnelDriver(); |
| 173 | |
| 174 | spdlog::info(L"uninstall OpenVPN DCO driver"); |
| 175 | UninstallOpenVPNDCODriver(path_for_installation); |
| 176 | |
| 177 | spdlog::info(L"uninstall tap-windows6 driver"); |
| 178 | UninstallTapWindows6Driver(path_for_installation); |
| 179 | |
| 180 | spdlog::info(L"perform uninstall"); |
| 181 | PerformUninstall(&DeleteUninstallDataFiles, path_for_installation); |
| 182 | |
| 183 | // open uninstall screen in browser |
| 184 | wstring userId; |
| 185 | Registry::RegQueryStringValue(HKEY_CURRENT_USER, L"Software\\Windscribe\\Windscribe2\\", L"userId", userId); |
| 186 | if (!userId.empty()) { |
| 187 | wstring urlStr = L"https://windscribe.com/uninstall/desktop?user=" + userId; |
| 188 | ::ShellExecute(nullptr, L"open", urlStr.c_str(), L"", L"", SW_SHOW); |
| 189 | } |
nothing calls this directly
no test coverage detected