Add Inno Setup Windows installer scaffold

This commit is contained in:
IgorRachkov
2026-04-29 07:11:20 +03:00
parent fa4bf96ebf
commit e3341f9de3
3 changed files with 276 additions and 0 deletions
@@ -0,0 +1,47 @@
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)][string]$ServerHost,
[int]$ServerPort = 5600,
[Parameter(Mandatory=$true)][string]$Domain,
[Parameter(Mandatory=$true)][string]$Users,
[string]$InstallRoot = 'C:\Program Files\ActivityWatch',
[string]$StateRoot = 'C:\ProgramData\ActivityWatch',
[string]$CustomRulesPath,
[string]$CustomPolicyPath,
[bool]$AfkEnabled = $true,
[bool]$WindowEnabled = $true
)
$ErrorActionPreference = 'Stop'
$scriptRoot = Split-Path -Parent $MyInvocation.MyCommand.Path
$ensembleScript = Join-Path $scriptRoot 'deploy-ensemble.ps1'
if (-not (Test-Path -LiteralPath $ensembleScript)) {
throw "deploy-ensemble.ps1 not found at $ensembleScript"
}
$usersList = $Users.Split(',') | ForEach-Object { $_.Trim() } | Where-Object { $_ }
if (-not $usersList -or $usersList.Count -eq 0) {
throw 'Users must contain at least one username.'
}
$params = @{
ServerHost = $ServerHost
ServerPort = $ServerPort
Domain = $Domain
Users = $usersList
InstallRoot = $InstallRoot
StateRoot = $StateRoot
AfkEnabled = $AfkEnabled
WindowEnabled = $WindowEnabled
}
if ($CustomRulesPath -and (Test-Path -LiteralPath $CustomRulesPath)) {
$params['CustomRulesPath'] = $CustomRulesPath
}
if ($CustomPolicyPath -and (Test-Path -LiteralPath $CustomPolicyPath)) {
$params['CustomPolicyPath'] = $CustomPolicyPath
}
& $ensembleScript @params