mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-14 08:41:28 +00:00
integrate script into installer
This commit is contained in:
4
dist/win/contrib/version170-migrate-settings.bat
vendored
Normal file
4
dist/win/contrib/version170-migrate-settings.bat
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
@echo off
|
||||
|
||||
cd %~dp0
|
||||
powershell -NoLogo -NonInteractive -ExecutionPolicy Unrestricted -Command .\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)) {
|
||||
4
dist/win/resources/main.wxs
vendored
4
dist/win/resources/main.wxs
vendored
@@ -132,6 +132,9 @@
|
||||
<!-- WebDAV patches -->
|
||||
<CustomAction Id="PatchWebDAV" Impersonate="no" ExeCommand="[INSTALLDIR]patchWebDAV.bat" Directory="INSTALLDIR" Execute="deferred" Return="asyncWait" />
|
||||
|
||||
<!-- Special Settings migration for 1.7.0 -->
|
||||
<CustomAction Id="170MigrateSettings" Impersonate="no" ExeCommand="[INSTALLDIR]version170-migrate-settings.bat" Directory="INSTALLDIR" Execute="deferred" Return="asyncWait" />
|
||||
|
||||
<!-- Running App detection and exit -->
|
||||
<Property Id="FOUNDRUNNINGAPP" Admin="yes"/>
|
||||
<util:CloseApplication
|
||||
@@ -182,6 +185,7 @@
|
||||
<RemoveExistingProducts After="InstallValidate"/>
|
||||
|
||||
<Custom Action="PatchWebDAV" After="InstallFiles">NOT Installed OR REINSTALL</Custom>
|
||||
<Custom Action="170MigrateSettings" After="InstallFiles">NOT Installed OR REINSTALL</Custom>
|
||||
</InstallExecuteSequence>
|
||||
|
||||
<WixVariable Id="WixUIBannerBmp" Value="$(env.JP_WIXWIZARD_RESOURCES)\banner.bmp" />
|
||||
|
||||
Reference in New Issue
Block a user