From a1379bac401d26bd92897e12a30970be71fe047f Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 22 Feb 2023 15:33:37 +0100 Subject: [PATCH] For Windows try to migrate all user settings, not only the ones of local users --- dist/win/contrib/version170-migrate-settings.ps1 | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/dist/win/contrib/version170-migrate-settings.ps1 b/dist/win/contrib/version170-migrate-settings.ps1 index 11b9e29e3..8e019fe66 100644 --- a/dist/win/contrib/version170-migrate-settings.ps1 +++ b/dist/win/contrib/version170-migrate-settings.ps1 @@ -7,19 +7,9 @@ #Get all active, local user profiles $profileList = 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList' -$localUsers = Get-LocalUser | Where-Object {$_.Enabled} | ForEach-Object { $_.Name} - -Get-ChildItem $profileList | ForEach-Object { $_.GetValue("ProfileImagePath") } | Where-Object { - $profileNameMatches = ($_ | Select-String -Pattern "\\([^\\]+)$").Matches - if($profileNameMatches.Count -eq 1) { - #check if the last path part is contained in the local user name list - #otherwise do not touch it - return $localUsers.Contains($profileNameMatches[0].Groups[1].Value) - } else { - return $false; - } -} | ForEach-Object { - $settingsPath = "$_\AppData\Roaming\Cryptomator\settings.json" +Get-ChildItem $profileList | ForEach-Object { + $profilePath = $_.GetValue("ProfileImagePath") + $settingsPath = "$profilePath\AppData\Roaming\Cryptomator\settings.json" if(!(Test-Path -Path $settingsPath -PathType Leaf)) { #No settings file, nothing to do. return;