From 7cc73c253de970d900b5c2317e83fbea7be9976c Mon Sep 17 00:00:00 2001 From: christian Date: Thu, 8 Oct 2026 14:55:00 -0400 Subject: [PATCH] windows-setup: the Bible app task also opens it 15 s after login The Startup-folder shortcut on the Sanctuary TV PC is switched off in Startup apps, so the app stayed closed after a restart. The StatusPanel task now has a logon trigger (set live on that PC over SSH too), and a re-run of the script keeps it. Co-Authored-By: Claude Opus 5.5 --- remote-access/windows-setup.ps1 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/remote-access/windows-setup.ps1 b/remote-access/windows-setup.ps1 index 6ce6807..2ba52aa 100644 --- a/remote-access/windows-setup.ps1 +++ b/remote-access/windows-setup.ps1 @@ -72,7 +72,7 @@ $apps = @( @{ Name = 'OBS'; Exe = (Find-First @("$env:ProgramFiles\obs-studio\bin\64bit\obs64.exe")); Args = '--disable-shutdown-check' }, @{ Name = 'Arena'; Exe = (Find-First (Get-ChildItem "$env:ProgramFiles\Resolume Arena*\Arena.exe" -ErrorAction SilentlyContinue | ForEach-Object FullName)); Args = '' }, @{ Name = 'rtpMIDI'; Exe = (Find-First @("${env:ProgramFiles(x86)}\Tobias Erichsen\rtpMIDI\rtpMIDI.exe", "$env:ProgramFiles\Tobias Erichsen\rtpMIDI\rtpMIDI.exe")); Args = '' }, - @{ Name = 'BibleApp'; Exe = $bible; Args = '' } + @{ Name = 'BibleApp'; Exe = $bible; Args = ''; AtLogon = $true } # also opens it 15 s after login ) $principal = New-ScheduledTaskPrincipal -UserId "$env:USERDOMAIN\$env:USERNAME" -LogonType Interactive -RunLevel Limited $settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries ` @@ -83,9 +83,14 @@ foreach ($app in $apps) { $actionArgs = @{ Execute = $app.Exe; WorkingDirectory = (Split-Path $app.Exe) } if ($app.Args) { $actionArgs.Argument = $app.Args } $action = New-ScheduledTaskAction @actionArgs - Register-ScheduledTask -TaskPath '\StatusPanel\' -TaskName ('Start ' + $app.Name) -Action $action ` - -Principal $principal -Settings $settings -Force | Out-Null - $tasks += ('{0} = {1}' -f $app.Name, $app.Exe) + $taskArgs = @{ TaskPath = '\StatusPanel\'; TaskName = ('Start ' + $app.Name); Action = $action + Principal = $principal; Settings = $settings; Force = $true } + if ($app.AtLogon) { + $taskArgs.Trigger = New-ScheduledTaskTrigger -AtLogOn -User "$env:USERDOMAIN\$env:USERNAME" + $taskArgs.Trigger.Delay = 'PT15S' + } + Register-ScheduledTask @taskArgs | Out-Null + $tasks += ('{0} = {1}{2}' -f $app.Name, $app.Exe, $(if ($app.AtLogon) { ' (also at login)' } else { '' })) } # 4. Wake-on-LAN: let the wired adapter wake the PC (the BIOS setting must be on too)