summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDavid Lönnhager <david.l@mullvad.net>2026-04-10 17:20:55 +0200
committerDavid Lönnhager <david.l@mullvad.net>2026-04-10 17:20:55 +0200
commit1908800412b00bb7e72267d18ae83fcaed9a7452 (patch)
tree9ec7635bb0e02a09607db2867e9312cd109162bc
parentf5b7cc676a6408b637417303ea7b9cb6781e028a (diff)
parentfe8b28f7822ef72b6408fa880297e944d201d20c (diff)
downloadmullvadvpn-1908800412b00bb7e72267d18ae83fcaed9a7452.tar.xz
mullvadvpn-1908800412b00bb7e72267d18ae83fcaed9a7452.zip
Merge branch 'remove-installer-migration'
-rw-r--r--dist-assets/windows/installer.nsh35
-rw-r--r--windows/nsis-plugins/src/cleanup/cleaningops.cpp44
-rw-r--r--windows/nsis-plugins/src/cleanup/cleaningops.h2
-rw-r--r--windows/nsis-plugins/src/cleanup/cleanup.cpp30
-rw-r--r--windows/nsis-plugins/src/cleanup/cleanup.def1
5 files changed, 0 insertions, 112 deletions
diff --git a/dist-assets/windows/installer.nsh b/dist-assets/windows/installer.nsh
index b82bdd3b87..5951a8ae19 100644
--- a/dist-assets/windows/installer.nsh
+++ b/dist-assets/windows/installer.nsh
@@ -365,40 +365,6 @@ ManifestSupportedOS "{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"
!define InstallTrayIcon '!insertmacro "InstallTrayIcon"'
#
-# MigrateCache
-#
-# Move old cache files to the new cache directory.
-# This is for upgrades from versions <= 2020.8-beta2.
-#
-!macro MigrateCache
-
- log::Log "MigrateCache()"
-
- Push $0
- Push $1
-
- cleanup::MigrateCache
-
- Pop $0
- Pop $1
-
- ${If} $0 != ${MULLVAD_SUCCESS}
- log::Log "Failed to migrate cache: $1"
- Goto MigrateCache_return
- ${EndIf}
-
- log::Log "MigrateCache() completed successfully"
-
- MigrateCache_return:
-
- Pop $1
- Pop $0
-
-!macroend
-
-!define MigrateCache '!insertmacro "MigrateCache"'
-
-#
# RemoveLogsAndCache
#
# Call into helper DLL instructing it to remove all logs and cache
@@ -812,7 +778,6 @@ ManifestSupportedOS "{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"
SetShellVarContext current
RMDir /r "$LOCALAPPDATA\mullvad-vpn-updater"
- ${MigrateCache}
${RemoveRelayCache}
${RemoveApiAddressCache}
diff --git a/windows/nsis-plugins/src/cleanup/cleaningops.cpp b/windows/nsis-plugins/src/cleanup/cleaningops.cpp
index 917b9356cf..a418ac0e3f 100644
--- a/windows/nsis-plugins/src/cleanup/cleaningops.cpp
+++ b/windows/nsis-plugins/src/cleanup/cleaningops.cpp
@@ -114,50 +114,6 @@ size_t EqualTokensCount(It lhsBegin, It lhsEnd, It rhsBegin, It rhsEnd)
namespace cleaningops
{
-//
-// Migrate cache for versions <= 2020.8-beta2.
-//
-void MigrateCacheServiceUser()
-{
- const auto newCacheDir = GetSystemCacheDirectory();
- common::fs::Mkdir(newCacheDir);
-
- const auto localAppData = GetSystemUserLocalAppData();
-
- const auto oldCacheDir = std::filesystem::path(localAppData).append(L"Mullvad VPN");
-
- common::fs::ScopedNativeFileSystem nativeFileSystem;
-
- common::security::AddAdminToObjectDacl(oldCacheDir, SE_FILE_OBJECT);
-
- {
- common::fs::FileEnumerator files(oldCacheDir);
-
- auto notNamedSet = std::make_unique<common::fs::FilterNotNamedSet>();
-
- notNamedSet->addObject(L"account-history.json");
- notNamedSet->addObject(L"settings.json");
- notNamedSet->addObject(L"device.json");
-
- files.addFilter(std::move(notNamedSet));
- files.addFilter(std::make_unique<common::fs::FilterFiles>());
-
- WIN32_FIND_DATAW file;
-
- while (files.next(file))
- {
- const auto source = std::filesystem::path(files.getDirectory()).append(file.cFileName);
- const auto target = std::filesystem::path(newCacheDir).append(file.cFileName);
- std::filesystem::rename(source, target);
- }
- }
-
- //
- // This fails unless the directory is empty. Settings remain in this directory.
- //
- RemoveDirectoryW(std::wstring(L"\\\\?\\").append(oldCacheDir).c_str());
-}
-
void RemoveLogsCacheCurrentUser()
{
const auto localAppData = common::fs::GetKnownFolderPath(FOLDERID_LocalAppData);
diff --git a/windows/nsis-plugins/src/cleanup/cleaningops.h b/windows/nsis-plugins/src/cleanup/cleaningops.h
index 47633ffb03..057eb305b8 100644
--- a/windows/nsis-plugins/src/cleanup/cleaningops.h
+++ b/windows/nsis-plugins/src/cleanup/cleaningops.h
@@ -3,8 +3,6 @@
namespace cleaningops
{
-void MigrateCacheServiceUser();
-
void RemoveLogsCacheCurrentUser();
void RemoveLogsCacheOtherUsers();
void RemoveLogsServiceUser();
diff --git a/windows/nsis-plugins/src/cleanup/cleanup.cpp b/windows/nsis-plugins/src/cleanup/cleanup.cpp
index 7c49c431d2..ab13e621a5 100644
--- a/windows/nsis-plugins/src/cleanup/cleanup.cpp
+++ b/windows/nsis-plugins/src/cleanup/cleanup.cpp
@@ -79,36 +79,6 @@ 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,
diff --git a/windows/nsis-plugins/src/cleanup/cleanup.def b/windows/nsis-plugins/src/cleanup/cleanup.def
index 3cbca616d2..5253448609 100644
--- a/windows/nsis-plugins/src/cleanup/cleanup.def
+++ b/windows/nsis-plugins/src/cleanup/cleanup.def
@@ -4,7 +4,6 @@ EXPORTS
CloseHoggingProcesses
IsEmptyDir
-MigrateCache
RemoveLogsAndCache
RemoveSettings
RemoveRelayCache