ci(services): changes to reinclude .exe exclusion

This commit is contained in:
2025-09-07 11:02:36 -05:00
parent 52888246ff
commit 6a717c81e5

View File

@@ -11,7 +11,7 @@ param (
)
# Example string to run with the parameters in it.
# .C:\scripts\services.ps1 -serviceName "LST_ctl" -option "install" -appPath "E:\LST" -description "Logistics Support Tool controller" -command "E:\LST\controller\lst_ctl.exe"
# .\scripts\services.ps1 -serviceName "LST_ctl" -option "install" -appPath "E:\LST" -description "Logistics Support Tool controller" -command "E:\LST\controller\lst_ctl.exe"
# .\scripts\services.ps1 -serviceName "LST_app" -option "install" -appPath "E:\LST" -description "Logistics Support Tool" -command "run start"
$nssmPath = $AppPath + "\nssm.exe"
@@ -87,7 +87,8 @@ if($remote -eq "true"){
}
Invoke-Command -ComputerName $server -ScriptBlock $plantFunness -ArgumentList $serviceName, $option, $appPath -Credential $credentials
} else {
}
else {
if (-not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Host "Error: This script must be run as Administrator."
@@ -169,9 +170,10 @@ if($remote -eq "true"){
& $nssmPath install $serviceName $command
$fullAppPath = "$appPath\app"
$fullAppPath = $appPath
& $nssmPath set $serviceName AppDirectory $fullAppPath
}else {
}
else {
& $nssmPath install $serviceName $npmPath $command
& $nssmPath set $serviceName AppDirectory $appPath
}
@@ -184,7 +186,8 @@ if($remote -eq "true"){
# Set recovery options
sc.exe failure $serviceName reset= 0 actions= restart/5000/restart/5000/restart/5000
& $nssmPath start $serviceName
}else{
}
else {
write-host $serviceName "is already installed will push the updated info"
Write-Host "Updating $serviceName..."
& $nssmPath stop $serviceName
@@ -192,7 +195,8 @@ if($remote -eq "true"){
if ($command.Contains(".exe")) {
$fullAppPath = "$appPath\app"
& $nssmPath set $serviceName AppDirectory $fullAppPath
}else {
}
else {
& $nssmPath set $serviceName AppDirectory $appPath
}