Removed the DEM file system dependency
This commit is contained in:
@@ -15,6 +15,19 @@ $ErrorActionPreference = 'Stop'
|
||||
$configPath = Join-Path $PSScriptRoot '..\config.psd1'
|
||||
$config = Import-PowerShellDataFile -Path $configPath
|
||||
|
||||
# --- Verify required project files are accessible ---
|
||||
$requiredPaths = @(
|
||||
(Join-Path $PSScriptRoot '..\obs-config\global.ini')
|
||||
(Join-Path $PSScriptRoot '..\obs-config\plugin_config\obs-websocket\config.json')
|
||||
(Join-Path $PSScriptRoot 'Show-ReplayTray.ps1')
|
||||
$config.OBSExecutable
|
||||
)
|
||||
foreach ($path in $requiredPaths) {
|
||||
if (-not (Test-Path -Path $path)) {
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# --- Skip if OBS is already running (handles reconnect scenarios) ---
|
||||
if (Get-Process -Name 'obs64' -ErrorAction SilentlyContinue) {
|
||||
exit 0
|
||||
@@ -32,6 +45,16 @@ $screen = [System.Windows.Forms.Screen]::PrimaryScreen
|
||||
$width = $screen.Bounds.Width
|
||||
$height = $screen.Bounds.Height
|
||||
|
||||
# --- Deploy global OBS config and WebSocket plugin config ---
|
||||
$obsConfigRoot = "$env:APPDATA\obs-studio"
|
||||
$sourceConfig = Join-Path $PSScriptRoot '..\obs-config'
|
||||
|
||||
Copy-Item -Path "$sourceConfig\global.ini" -Destination "$obsConfigRoot\global.ini" -Force
|
||||
|
||||
$wsConfigDir = "$obsConfigRoot\plugin_config\obs-websocket"
|
||||
New-Item -ItemType Directory -Path $wsConfigDir -Force | Out-Null
|
||||
Copy-Item -Path "$sourceConfig\plugin_config\obs-websocket\config.json" -Destination "$wsConfigDir\config.json" -Force
|
||||
|
||||
# --- Write OBS profile (basic.ini) ---
|
||||
$profileDir = "$env:APPDATA\obs-studio\basic\profiles\$($config.ProfileName)"
|
||||
New-Item -ItemType Directory -Path $profileDir -Force | Out-Null
|
||||
@@ -70,8 +93,10 @@ $obsArgs = @(
|
||||
'--minimize-to-tray'
|
||||
'--startreplaybuffer'
|
||||
'--disable-updater'
|
||||
"--profile `"$($config.ProfileName)`""
|
||||
"--collection `"$($config.SceneCollection)`""
|
||||
'--profile'
|
||||
$config.ProfileName
|
||||
'--collection'
|
||||
$config.SceneCollection
|
||||
)
|
||||
|
||||
Start-Process -FilePath $config.OBSExecutable -ArgumentList $obsArgs -WindowStyle Hidden
|
||||
|
||||
Reference in New Issue
Block a user