From 49ffb4be384c036a95e83f24d56c5c961e8f1c27 Mon Sep 17 00:00:00 2001 From: Altoid0 <39836458+Altoid0@users.noreply.github.com> Date: Wed, 2 Jun 2021 20:42:17 -0700 Subject: [PATCH] CSSClient service scheduled task (#121) --- cmd/release_windows.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cmd/release_windows.go b/cmd/release_windows.go index 813daffc..98852ea9 100644 --- a/cmd/release_windows.go +++ b/cmd/release_windows.go @@ -115,13 +115,20 @@ func InstallService() { cmdString = `sc.exe description CSSClient "This is Aeacus's Competition Scoring System client. Don't stop or mess with this unless you want to not get points, and maybe have your registry deleted."` shellCommand(cmdString) infoPrint("Setting up TeamID scheduled task...") - taskCreate := ` + idTaskCreate := ` $action = New-ScheduledTaskAction -Execute "C:\aeacus\phocus.exe" -Argument "-i yes" $trigger = New-ScheduledTaskTrigger -AtLogon $principal = New-ScheduledTaskPrincipal -GroupId "BUILTIN\Administrators" -RunLevel Highest Register-ScheduledTask -TaskName "TeamID" -Description "Scheduled Task to ensure Aeacus TeamID prompt is displayed when needed" -Action $action -Trigger $trigger -Principal $principal ` - shellCommand(taskCreate) + serviceTaskCreate := ` + $action = New-ScheduledTaskAction -Execute "net.exe" -Argument "start CSSClient" + $trigger = New-ScheduledTaskTrigger -AtLogon + $principal = New-ScheduledTaskPrincipal -GroupId "BUILTIN\Administrators" -RunLevel Highest + Register-ScheduledTask -TaskName "CSSClient" -Description "Scheduled Task to ensure the CSSClient service remains up" -Action $action -Trigger $trigger -Principal $principal + ` + shellCommand(idTaskCreate) + shellCommand(serviceTaskCreate) } // CleanUp clears out sensitive files left behind by