From a106b04c7e7bbf045b43df3ab96f8aeda7fe1048 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Mon, 30 Jan 2023 13:30:06 +0100 Subject: [PATCH] prototpye for powershell script to be executed after installation --- dist/win/contrib/170FuseMigration.ps1 | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 dist/win/contrib/170FuseMigration.ps1 diff --git a/dist/win/contrib/170FuseMigration.ps1 b/dist/win/contrib/170FuseMigration.ps1 new file mode 100644 index 000000000..203913ae7 --- /dev/null +++ b/dist/win/contrib/170FuseMigration.ps1 @@ -0,0 +1,12 @@ +$settingsPath = 'C:\Users\Arbeit\AppData\Roaming\Cryptomator-Dev\settings1617.json' +$settings = Get-Content -Path $settingsPath | ConvertFrom-Json +$atLeastOneCustomPath = $false; +foreach ($vault in $settings.directories){ + $atLeastOneCustomPath = $atLeastOneCustomPath -or ($vault.useCustomMountPath -eq "True") +} + +if( $atLeastOneCustomPath -and ($settings.preferredVolumeImpl -eq "FUSE")) { + Add-Member -Force -InputObject $settings -Name "mountService" -Value "org.cryptomator.frontend.fuse.mount.WinFspMountProvider" -MemberType NoteProperty + $newSettings = $settings | Select-Object * -ExcludeProperty "preferredVolumeImpl" + ConvertTo-Json $newSettings | Set-Content -Path $settingsPath +}