Keep Raven Vili task background-only

This commit is contained in:
Meta Vens 2026-06-16 02:25:13 +01:00
commit 7cb320d11f
3 changed files with 4 additions and 2 deletions

View file

@ -6,12 +6,13 @@ param(
)
$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
$HiddenLauncher = Join-Path $PSScriptRoot "run-hidden-powershell.vbs"
$RunScript = Join-Path $PSScriptRoot "start-vili-daemon.ps1"
$Action = New-ScheduledTaskAction -Execute "wscript.exe" -Argument "//B //nologo `"$HiddenLauncher`" -NoProfile -NonInteractive -WindowStyle Hidden -ExecutionPolicy Bypass -File `"$RunScript`" -Port $Port -HostName `"$HostName`" -StateRoot `"$StateRoot`""
$Trigger = New-ScheduledTaskTrigger -AtStartup
$UserId = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
$Principal = New-ScheduledTaskPrincipal -UserId $UserId -LogonType Interactive -RunLevel Highest
$Principal = New-ScheduledTaskPrincipal -UserId $UserId -LogonType Interactive -RunLevel Limited
$Settings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries -DontStopIfGoingOnBatteries -ExecutionTimeLimit ([TimeSpan]::Zero) -MultipleInstances IgnoreNew -Hidden
Register-ScheduledTask -TaskName $TaskName -Action $Action -Trigger $Trigger -Principal $Principal -Settings $Settings -Force | Out-Null

View file

@ -1,2 +1,2 @@
@echo off
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0restart-vili-daemon.ps1" %*
powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "%~dp0restart-vili-daemon.ps1" %*

View file

@ -5,6 +5,7 @@ param(
)
$ErrorActionPreference = "Stop"
$ProgressPreference = "SilentlyContinue"
$PidPath = Join-Path $StateRoot "vili-daemon.pid"
$TaskName = "GameCult\Vili"