From 7b65f5f27d9e0e3c3f3cce786cd72aff1fa3d620 Mon Sep 17 00:00:00 2001 From: mrhid6 Date: Fri, 17 Jul 2026 11:35:09 +0100 Subject: [PATCH] ci: package windows agent as WiX MSI --- installer/setup.ps1 | 25 +++++++++++++++++++++ installer/vantage-agent.wxs | 44 +++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 installer/setup.ps1 create mode 100644 installer/vantage-agent.wxs diff --git a/installer/setup.ps1 b/installer/setup.ps1 new file mode 100644 index 0000000..e7449d4 --- /dev/null +++ b/installer/setup.ps1 @@ -0,0 +1,25 @@ +param( + [string]$ServerId, + [string]$Token, + [string]$ServerUrl, + [string]$InstallDir +) +$cfgDir = Join-Path $env:ProgramData "vantage" +New-Item -ItemType Directory -Force -Path $cfgDir | Out-Null +$cfg = @" +server_url: "$ServerUrl" +server_id: "$ServerId" +pre_reg_token: "$Token" +agent_token: "" +poll_interval: 30s +tls: true +"@ +Set-Content -Path (Join-Path $cfgDir "config.yaml") -Value $cfg -Encoding utf8 +# Lock down ACL: SYSTEM + Administrators only +icacls (Join-Path $cfgDir "config.yaml") /inheritance:r /grant:r "SYSTEM:F" "Administrators:F" | Out-Null + +$nssm = Join-Path $InstallDir "nssm.exe" +$exe = Join-Path $InstallDir "vantage-agent.exe" +& $nssm install VantageAgent $exe +& $nssm set VantageAgent Start SERVICE_AUTO_START +& $nssm start VantageAgent diff --git a/installer/vantage-agent.wxs b/installer/vantage-agent.wxs new file mode 100644 index 0000000..9e012b8 --- /dev/null +++ b/installer/vantage-agent.wxs @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +