param( [string]$ObsPath = "C:\Program Files\obs-studio", [string]$Dll = "", [string]$DataDir = "" ) $ErrorActionPreference = "Stop" $root = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path if ([string]::IsNullOrEmpty($Dll)) { $Dll = Join-Path $root "build\bin\audio-waveform-dock.dll" } if ([string]::IsNullOrEmpty($DataDir)) { $DataDir = Join-Path $root "data" } if (-not (Test-Path $Dll)) { throw "Plugin DLL not found: $Dll (run scripts/build.ps1 first)" } if (-not (Test-Path (Join-Path $ObsPath "obs64.exe")) -and -not (Test-Path (Join-Path $ObsPath "bin\64bit\obs64.exe"))) { throw "OBS not found at '$ObsPath'" } if (Get-Process obs64 -ErrorAction SilentlyContinue) { throw "OBS is running. Please close OBS before installing the plugin." } $pluginDir = Join-Path $ObsPath "obs-plugins\64bit" $dataTarget = Join-Path $ObsPath "data\obs-plugins\audio-waveform-dock" $localeTarget = Join-Path $dataTarget "locale" New-Item -ItemType Directory -Force $pluginDir | Out-Null New-Item -ItemType Directory -Force $localeTarget | Out-Null Copy-Item $Dll (Join-Path $pluginDir "audio-waveform-dock.dll") -Force Copy-Item (Join-Path $DataDir "locale\*.ini") $localeTarget -Force Write-Host "Installed to $ObsPath" Write-Host " $pluginDir\audio-waveform-dock.dll" Write-Host " $dataTarget\locale\*.ini" Write-Host "Start OBS and look for the '音频波形监视 / Audio Waveform Monitor' dock."