23 lines
690 B
PowerShell
23 lines
690 B
PowerShell
#Requires -RunAsAdministrator
|
|
param(
|
|
[string]$ProjectRoot = "",
|
|
[string]$DataRoot = "",
|
|
[string]$NssmPath = "nssm.exe"
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
if ([string]::IsNullOrWhiteSpace($ProjectRoot)) {
|
|
$ProjectRoot = if ($env:GYXX_PROJECT_ROOT) {
|
|
$env:GYXX_PROJECT_ROOT
|
|
} else {
|
|
(Resolve-Path (Join-Path $PSScriptRoot "..\..\..\..\..\..")).Path
|
|
}
|
|
}
|
|
$installer = Join-Path $ProjectRoot "deploy\windows-service\install.ps1"
|
|
if (-not (Test-Path -LiteralPath $installer -PathType Leaf)) {
|
|
throw "Server scheduler installer is missing: $installer"
|
|
}
|
|
|
|
& $installer -ProjectRoot $ProjectRoot -DataRoot $DataRoot -NssmPath $NssmPath
|
|
exit $LASTEXITCODE
|