diff --git a/dist/win/contrib/version170-migrate-settings.bat b/dist/win/contrib/version170-migrate-settings.bat new file mode 100644 index 000000000..ac8d59dfa --- /dev/null +++ b/dist/win/contrib/version170-migrate-settings.bat @@ -0,0 +1,4 @@ +@echo off + +cd %~dp0 +powershell -NoLogo -NonInteractive -ExecutionPolicy Unrestricted -Command .\version170-migrate-settings.ps1 \ No newline at end of file diff --git a/dist/win/contrib/170FuseMigration.ps1 b/dist/win/contrib/version170-migrate-settings.ps1 similarity index 81% rename from dist/win/contrib/170FuseMigration.ps1 rename to dist/win/contrib/version170-migrate-settings.ps1 index 8c740b3de..92bb037cf 100644 --- a/dist/win/contrib/170FuseMigration.ps1 +++ b/dist/win/contrib/version170-migrate-settings.ps1 @@ -1,4 +1,5 @@ -# This script migrates Cryptomator settings for all local users on Windows in case a custom directory is used +# This script migrates Cryptomator settings for all local users on Windows in case the users uses custom directories as mountpoint +# #Requires -RunAsAdministrator #Get all active, local user profiles @@ -6,11 +7,14 @@ $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 { - $matches = ($_ | Select-String -Pattern "\\([^\\]+)$").Matches - if($matches.Count -eq 1) { + $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($matches[0].Groups[1].Value) + } else { + return $false; } - return $false; } | ForEach-Object { $settingsPath = "$_\AppData\Roaming\Cryptomator\settings.json" if(!(Test-Path -Path $settingsPath)) { diff --git a/dist/win/resources/main.wxs b/dist/win/resources/main.wxs index d6247bf05..58b72b5b4 100644 --- a/dist/win/resources/main.wxs +++ b/dist/win/resources/main.wxs @@ -132,6 +132,9 @@ + + + NOT Installed OR REINSTALL + NOT Installed OR REINSTALL