diff options
| author | David Lönnhager <david.l@mullvad.net> | 2021-01-08 18:15:31 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2021-01-12 16:10:21 +0100 |
| commit | a9649be8cdca53a076e50b999f250fc216903487 (patch) | |
| tree | 5e4c21f2373ccfed703d3954d5ea4dbf2bbf92f4 /windows/nsis-plugins/src/cleanup/cleanup.cpp | |
| parent | 55249da9c8f7f2e86ea946be393b5f0e98c44765 (diff) | |
| download | mullvadvpn-a9649be8cdca53a076e50b999f250fc216903487.tar.xz mullvadvpn-a9649be8cdca53a076e50b999f250fc216903487.zip | |
Migrate old cache files on Windows
Diffstat (limited to 'windows/nsis-plugins/src/cleanup/cleanup.cpp')
| -rw-r--r-- | windows/nsis-plugins/src/cleanup/cleanup.cpp | 32 |
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, |
