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 <noreply@anthropic.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user