summaryrefslogtreecommitdiffhomepage
path: root/windows/nsis-plugins/src/cleanup/cleanup.cpp
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2021-01-12 16:16:04 +0100
committerDavid Lönnhager <david.l@mullvad.net>2021-01-12 16:16:04 +0100
commitc9084190dd2e18bbbe121f1947a6129dbbfdce2a (patch)
tree117257f53b2f9b1a70be847c1c4f4dfb9641e8a0 /windows/nsis-plugins/src/cleanup/cleanup.cpp
parent12ca4a60bf3455132aed849ad8d5df87cd919d35 (diff)
parenta3c3094238e249a89df4b08e0e5c83cef570c5f0 (diff)
downloadmullvadvpn-c9084190dd2e18bbbe121f1947a6129dbbfdce2a.tar.xz
mullvadvpn-c9084190dd2e18bbbe121f1947a6129dbbfdce2a.zip
Merge branch 'migrate-cache-dir'
Diffstat (limited to 'windows/nsis-plugins/src/cleanup/cleanup.cpp')
-rw-r--r--windows/nsis-plugins/src/cleanup/cleanup.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/windows/nsis-plugins/src/cleanup/cleanup.cpp b/windows/nsis-plugins/src/cleanup/cleanup.cpp
index 528efb2f7a..ca943934a7 100644
--- a/windows/nsis-plugins/src/cleanup/cleanup.cpp
+++ b/windows/nsis-plugins/src/cleanup/cleanup.cpp
@@ -23,8 +23,8 @@ void __declspec(dllexport) NSISCALL RemoveLogsAndCache
{
cleaningops::RemoveLogsCacheCurrentUser,
cleaningops::RemoveLogsCacheOtherUsers,
- cleaningops::RemoveLogsServiceUser,
cleaningops::RemoveCacheServiceUser,
+ cleaningops::RemoveLogsServiceUser,
};
bool success = true;
@@ -47,6 +47,36 @@ void __declspec(dllexport) NSISCALL RemoveLogsAndCache
pushint(success ? NsisStatus::SUCCESS : NsisStatus::GENERAL_ERROR);
}
+void __declspec(dllexport) NSISCALL MigrateCache
+(
+ HWND hwndParent,
+ int string_size,
+ LPTSTR variables,
+ stack_t** stacktop,
+ extra_parameters* extra,
+ ...
+)
+{
+ EXDLL_INIT();
+
+ try
+ {
+ cleaningops::MigrateCacheServiceUser();
+ pushstring(L"");
+ pushint(NsisStatus::SUCCESS);
+ }
+ catch (std::exception &err)
+ {
+ pushstring(common::string::ToWide(err.what()).c_str());
+ pushint(NsisStatus::GENERAL_ERROR);
+ }
+ catch (...)
+ {
+ pushstring(L"Unspecified error");
+ pushint(NsisStatus::GENERAL_ERROR);
+ }
+}
+
void __declspec(dllexport) NSISCALL RemoveSettings
(
HWND hwndParent,