summaryrefslogtreecommitdiffhomepage
path: root/windows/nsis-plugins/src/cleanup/cleaningops.cpp
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2020-12-02 17:36:39 +0100
committerDavid Lönnhager <david.l@mullvad.net>2021-01-04 16:50:18 +0100
commit29260429f5cdf04ef4e51a42a4abd11f5e2e03b7 (patch)
tree35db7806efabbf85c79cc919dc2fea07f30578ff /windows/nsis-plugins/src/cleanup/cleaningops.cpp
parent1680065e267b84f1443317ae942cd0c609e86b14 (diff)
downloadmullvadvpn-29260429f5cdf04ef4e51a42a4abd11f5e2e03b7.tar.xz
mullvadvpn-29260429f5cdf04ef4e51a42a4abd11f5e2e03b7.zip
Always prefer the last used API address
Diffstat (limited to 'windows/nsis-plugins/src/cleanup/cleaningops.cpp')
-rw-r--r--windows/nsis-plugins/src/cleanup/cleaningops.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/windows/nsis-plugins/src/cleanup/cleaningops.cpp b/windows/nsis-plugins/src/cleanup/cleaningops.cpp
index 475c78d8b7..1a711bf3d8 100644
--- a/windows/nsis-plugins/src/cleanup/cleaningops.cpp
+++ b/windows/nsis-plugins/src/cleanup/cleaningops.cpp
@@ -333,14 +333,14 @@ void RemoveRelayCacheServiceUser()
void RemoveApiAddressCacheServiceUser()
{
- const auto localAppData = GetSystemUserLocalAppData();
- const auto mullvadAppData = std::filesystem::path(localAppData).append(L"Mullvad VPN");
+ const auto programData = common::fs::GetKnownFolderPath(FOLDERID_ProgramData, KF_FLAG_DEFAULT, nullptr);
+ const auto mullvadProgramData = std::filesystem::path(programData).append(L"Mullvad VPN");
common::fs::ScopedNativeFileSystem nativeFileSystem;
- common::security::AddAdminToObjectDacl(mullvadAppData, SE_FILE_OBJECT);
+ common::security::AddAdminToObjectDacl(mullvadProgramData, SE_FILE_OBJECT);
- const auto cacheFile = std::filesystem::path(mullvadAppData).append(L"api-ip-address.txt");
+ const auto cacheFile = std::filesystem::path(mullvadProgramData).append(L"api-ip-address.txt");
std::filesystem::remove(cacheFile);
}