feat: update to version 0.1.3 with new CLI flags, logging enhancements, and Windows MSI installer
This commit is contained in:
114
installer/Product.wxs
Normal file
114
installer/Product.wxs
Normal file
@@ -0,0 +1,114 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
|
||||
<Product
|
||||
Id="*"
|
||||
Name="Thor Ingest Agent"
|
||||
Language="1033"
|
||||
Version="0.1.3"
|
||||
Manufacturer="Seismo"
|
||||
UpgradeCode="0E2EFA7E-2A75-4A2E-A5D5-9E9C6B99C0E1">
|
||||
|
||||
<Package InstallerVersion="500" Compressed="yes" InstallScope="perMachine" Platform="x64" />
|
||||
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
|
||||
<MediaTemplate />
|
||||
|
||||
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
|
||||
|
||||
<Directory Id="TARGETDIR" Name="SourceDir">
|
||||
<Directory Id="ProgramFiles64Folder">
|
||||
<Directory Id="INSTALLFOLDER" Name="ThorIngest">
|
||||
<Component Id="MainExecutable" Guid="9A9F3E64-93A0-4D9F-8D2E-1C4B8B9E5E7A">
|
||||
<File Id="ThorIngestExe" Source="..\dist\thor-ingest-agent.exe" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Id="ConfigExample" Guid="A6B1877F-3C8C-4CE1-9C30-70C8E2D6CB8F">
|
||||
<File Id="ConfigExampleFile" Source="..\config.example.json" KeyPath="yes" />
|
||||
</Component>
|
||||
<Component Id="NssmBinary" Guid="F9E2D403-4F1C-4E55-8A34-0D7CBA74F2BC">
|
||||
<File Id="NssmExe" Source="tools\nssm.exe" KeyPath="yes" />
|
||||
</Component>
|
||||
</Directory>
|
||||
</Directory>
|
||||
<Directory Id="CommonAppDataFolder">
|
||||
<Directory Id="ProgramDataThorIngest" Name="ThorIngest">
|
||||
<Directory Id="ProgramDataLogs" Name="logs" />
|
||||
</Directory>
|
||||
</Directory>
|
||||
</Directory>
|
||||
|
||||
<Feature Id="MainFeature" Title="Thor Ingest Agent" Level="1">
|
||||
<ComponentRef Id="MainExecutable" />
|
||||
<ComponentRef Id="ConfigExample" />
|
||||
<ComponentRef Id="NssmBinary" />
|
||||
</Feature>
|
||||
|
||||
<CustomAction
|
||||
Id="CreateProgramDataDirs"
|
||||
Directory="TARGETDIR"
|
||||
ExeCommand="cmd.exe /c if not exist "[CommonAppDataFolder]ThorIngest\" mkdir "[CommonAppDataFolder]ThorIngest\" & if not exist "[CommonAppDataFolder]ThorIngest\logs\" mkdir "[CommonAppDataFolder]ThorIngest\logs\""
|
||||
Execute="deferred"
|
||||
Impersonate="no"
|
||||
Return="check" />
|
||||
|
||||
<CustomAction
|
||||
Id="CopyDefaultConfig"
|
||||
Directory="TARGETDIR"
|
||||
ExeCommand="cmd.exe /c if not exist "[CommonAppDataFolder]ThorIngest\config.json" copy "[INSTALLFOLDER]config.example.json" "[CommonAppDataFolder]ThorIngest\config.json""
|
||||
Execute="deferred"
|
||||
Impersonate="no"
|
||||
Return="check" />
|
||||
|
||||
<CustomAction
|
||||
Id="InstallService"
|
||||
Directory="INSTALLFOLDER"
|
||||
ExeCommand=""[INSTALLFOLDER]nssm.exe" install ThorIngest "[INSTALLFOLDER]thor-ingest-agent.exe" --config "[CommonAppDataFolder]ThorIngest\config.json" --log-dir "[CommonAppDataFolder]ThorIngest\logs""
|
||||
Execute="deferred"
|
||||
Impersonate="no"
|
||||
Return="check" />
|
||||
|
||||
<CustomAction
|
||||
Id="ConfigureServiceStart"
|
||||
Directory="INSTALLFOLDER"
|
||||
ExeCommand=""[INSTALLFOLDER]nssm.exe" set ThorIngest Start SERVICE_AUTO_START"
|
||||
Execute="deferred"
|
||||
Impersonate="no"
|
||||
Return="check" />
|
||||
|
||||
<CustomAction
|
||||
Id="ConfigureServiceRestart"
|
||||
Directory="INSTALLFOLDER"
|
||||
ExeCommand=""[INSTALLFOLDER]nssm.exe" set ThorIngest AppExit Default Restart"
|
||||
Execute="deferred"
|
||||
Impersonate="no"
|
||||
Return="check" />
|
||||
|
||||
<CustomAction
|
||||
Id="StartService"
|
||||
Directory="INSTALLFOLDER"
|
||||
ExeCommand=""[INSTALLFOLDER]nssm.exe" start ThorIngest"
|
||||
Execute="deferred"
|
||||
Impersonate="no"
|
||||
Return="check" />
|
||||
|
||||
<CustomAction
|
||||
Id="RemoveService"
|
||||
Directory="INSTALLFOLDER"
|
||||
ExeCommand=""[INSTALLFOLDER]nssm.exe" remove ThorIngest confirm"
|
||||
Execute="deferred"
|
||||
Impersonate="no"
|
||||
Return="check" />
|
||||
|
||||
<InstallExecuteSequence>
|
||||
<Custom Action="CreateProgramDataDirs" After="InstallFiles">NOT Installed</Custom>
|
||||
<Custom Action="CopyDefaultConfig" After="CreateProgramDataDirs">NOT Installed</Custom>
|
||||
<Custom Action="InstallService" After="CopyDefaultConfig">NOT Installed</Custom>
|
||||
<Custom Action="ConfigureServiceStart" After="InstallService">NOT Installed</Custom>
|
||||
<Custom Action="ConfigureServiceRestart" After="ConfigureServiceStart">NOT Installed</Custom>
|
||||
<Custom Action="StartService" After="ConfigureServiceRestart">NOT Installed</Custom>
|
||||
<Custom Action="RemoveService" Before="RemoveFiles">REMOVE="ALL"</Custom>
|
||||
</InstallExecuteSequence>
|
||||
|
||||
<UIRef Id="WixUI_Minimal" />
|
||||
<UIRef Id="WixUI_ErrorProgressText" />
|
||||
|
||||
</Product>
|
||||
</Wix>
|
||||
21
installer/README.md
Normal file
21
installer/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# Thor Ingest MSI Installer
|
||||
|
||||
This folder contains the WiX MSI definition and build script.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- WiX Toolset v3.11+ (set `WIX` env var to the WiX `bin` path)
|
||||
- `nssm.exe` placed at `installer/tools/nssm.exe`
|
||||
- `thor-ingest-agent.exe` built into `thor-ingest-agent/dist/`
|
||||
|
||||
## Build
|
||||
|
||||
```powershell
|
||||
./build.ps1
|
||||
```
|
||||
|
||||
The MSI output will be:
|
||||
|
||||
```
|
||||
installer/ThorIngest.msi
|
||||
```
|
||||
30
installer/build.ps1
Normal file
30
installer/build.ps1
Normal file
@@ -0,0 +1,30 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$WixBin = $env:WIX
|
||||
if (-not $WixBin) {
|
||||
Write-Error "WIX environment variable not set. Set WIX to your WiX Toolset bin path (e.g., C:\Program Files (x86)\WiX Toolset v3.11\bin)."
|
||||
}
|
||||
|
||||
$ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path
|
||||
$InstallerDir = $ScriptDir
|
||||
$RootDir = Resolve-Path (Join-Path $InstallerDir "..")
|
||||
|
||||
$ProductWxs = Join-Path $InstallerDir "Product.wxs"
|
||||
$DistDir = Join-Path $RootDir "dist"
|
||||
$NssmPath = Join-Path $InstallerDir "tools\nssm.exe"
|
||||
|
||||
if (-not (Test-Path $DistDir)) {
|
||||
Write-Error "dist folder not found. Build the EXE with PyInstaller first."
|
||||
}
|
||||
|
||||
if (-not (Test-Path $NssmPath)) {
|
||||
Write-Error "Missing nssm.exe at $NssmPath. Place the NSSM binary there before building."
|
||||
}
|
||||
|
||||
$candle = Join-Path $WixBin "candle.exe"
|
||||
$light = Join-Path $WixBin "light.exe"
|
||||
|
||||
& $candle -nologo $ProductWxs -out (Join-Path $InstallerDir "Product.wixobj")
|
||||
& $light -nologo -ext WixUIExtension -ext WixUtilExtension -out (Join-Path $InstallerDir "ThorIngest.msi") (Join-Path $InstallerDir "Product.wixobj")
|
||||
|
||||
Write-Host "Built MSI: $InstallerDir\ThorIngest.msi"
|
||||
1
installer/tools/README.txt
Normal file
1
installer/tools/README.txt
Normal file
@@ -0,0 +1 @@
|
||||
Place nssm.exe in this folder before building the MSI.
|
||||
Reference in New Issue
Block a user