summaryrefslogtreecommitdiffhomepage
path: root/windows/nsis-plugins/src/cleanup/cleaningops.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'windows/nsis-plugins/src/cleanup/cleaningops.cpp')
-rw-r--r--windows/nsis-plugins/src/cleanup/cleaningops.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/windows/nsis-plugins/src/cleanup/cleaningops.cpp b/windows/nsis-plugins/src/cleanup/cleaningops.cpp
index 8653bb50a9..475c78d8b7 100644
--- a/windows/nsis-plugins/src/cleanup/cleaningops.cpp
+++ b/windows/nsis-plugins/src/cleanup/cleaningops.cpp
@@ -331,4 +331,18 @@ void RemoveRelayCacheServiceUser()
std::filesystem::remove(cacheFile);
}
+void RemoveApiAddressCacheServiceUser()
+{
+ const auto localAppData = GetSystemUserLocalAppData();
+ const auto mullvadAppData = std::filesystem::path(localAppData).append(L"Mullvad VPN");
+
+ common::fs::ScopedNativeFileSystem nativeFileSystem;
+
+ common::security::AddAdminToObjectDacl(mullvadAppData, SE_FILE_OBJECT);
+
+ const auto cacheFile = std::filesystem::path(mullvadAppData).append(L"api-ip-address.txt");
+
+ std::filesystem::remove(cacheFile);
+}
+
}