This commit is contained in:
2025-10-12 01:30:44 +03:00
parent ec284d2385
commit e69ef60d7d
+12 -10
View File
@@ -5,13 +5,15 @@ param(
[string]$To [string]$To
) )
Write-Host "==============================" -ForegroundColor Gray
if (-not $From) { if (-not $From) {
Write-Error "No From path - aborting" Write-Error "No From path - aborting"
Exit 1 Exit 1
} }
if (-not [System.IO.Path]::IsPathRooted($To)) { if (-not [System.IO.Path]::IsPathRooted($To)) {
$To = Join-Path $env:ProgramFiles $AppName $To = Join-Path $env:ProgramFiles $AppName
Write-Host "Fixed To: $To" Write-Host "Fixed To: $To" -ForegroundColor Yellow
} }
$configDir = Join-Path $To "config" $configDir = Join-Path $To "config"
@@ -21,35 +23,35 @@ $vstDir = Join-Path $To "VSTPlugins"
$FabFilterLink = Join-Path $vstDir "FabFilter Pro-Q 3.dll" $FabFilterLink = Join-Path $vstDir "FabFilter Pro-Q 3.dll"
$globalDLL = "$env:ProgramFiles\VSTPlugins\FabFilter\FabFilter Pro-Q 3.dll" $globalDLL = "$env:ProgramFiles\VSTPlugins\FabFilter\FabFilter Pro-Q 3.dll"
Write-Host "Isolate: $AppName ($Action) | From: $From | To: $To" Write-Host "Isolate: $AppName ($Action) | From: $From | To: $To" -ForegroundColor Yellow
function Disconnect-App { function Disconnect-App {
Write-Host " Disconnecting..." Write-Host " Disconnecting..." -ForegroundColor Yellow
if (Test-Path $configDir) { if (Test-Path $configDir) {
Remove-Item $configDir -Recurse -Force -ErrorAction SilentlyContinue Remove-Item $configDir -Recurse -Force -ErrorAction SilentlyContinue
Write-Host " Config wiped" Write-Host " Config wiped" -ForegroundColor Red
} }
if (Test-Path $FabFilterLink) { if (Test-Path $FabFilterLink) {
Remove-Item $FabFilterLink -Force -ErrorAction SilentlyContinue Remove-Item $FabFilterLink -Force -ErrorAction SilentlyContinue
Write-Host " VST link removed" Write-Host " VST link removed" -ForegroundColor Red
} }
if (Test-Path $regPath) { if (Test-Path $regPath) {
Remove-ItemProperty -Path $regPath -Name $regKey -ErrorAction SilentlyContinue Remove-ItemProperty -Path $regPath -Name $regKey -ErrorAction SilentlyContinue
Write-Host " Registry cleaned" Write-Host " Registry cleaned" -ForegroundColor Red
} }
} }
function Connect-App { function Connect-App {
Write-Host " Connecting..." Write-Host " Connecting..." -ForegroundColor Yellow
if (-not (Test-Path $regPath)) { if (-not (Test-Path $regPath)) {
New-Item -Path $regPath -Force | Out-Null New-Item -Path $regPath -Force | Out-Null
} }
Set-ItemProperty -Path $regPath -Name $regKey -Value $From -Type String -Force Set-ItemProperty -Path $regPath -Name $regKey -Value $From -Type String -Force
Write-Host " ConfigPath -> $From" Write-Host " ConfigPath -> $From" -ForegroundColor Blue
if (-not (Test-Path $vstDir)) { if (-not (Test-Path $vstDir)) {
New-Item -ItemType Directory -Path $vstDir -Force | Out-Null New-Item -ItemType Directory -Path $vstDir -Force | Out-Null
@@ -59,7 +61,7 @@ function Connect-App {
} }
if (Test-Path $globalDLL) { if (Test-Path $globalDLL) {
New-Item -ItemType SymbolicLink -Path $FabFilterLink -Value $globalDLL -Force | Out-Null New-Item -ItemType SymbolicLink -Path $FabFilterLink -Value $globalDLL -Force | Out-Null
Write-Host " VST linked: $FabFilterLink -> $globalDLL" Write-Host " VST linked: $FabFilterLink -> $globalDLL" -ForegroundColor Blue
} else { } else {
Write-Warning " No system VST: $globalDLL (install it?)" Write-Warning " No system VST: $globalDLL (install it?)"
} }
@@ -75,4 +77,4 @@ switch ($Action.ToLower()) {
default { Write-Warning "Unknown action: $Action" } default { Write-Warning "Unknown action: $Action" }
} }
Write-Host "Done with $AppName" Write-Host "Done with $AppName" -ForegroundColor Green