47 lines
1.6 KiB
PowerShell
47 lines
1.6 KiB
PowerShell
|
|
# Dragonflight Premiere panel — Windows installer build
|
||
|
|
#
|
||
|
|
# Parses the version from ../CSXS/manifest.xml and hands it to ISCC.exe.
|
||
|
|
# Requires Inno Setup 6 on PATH (winget install JRSoftware.InnoSetup).
|
||
|
|
#
|
||
|
|
# Usage: pwsh -File build-installer.ps1
|
||
|
|
|
||
|
|
$ErrorActionPreference = 'Stop'
|
||
|
|
Set-Location $PSScriptRoot
|
||
|
|
|
||
|
|
$manifestPath = Join-Path $PSScriptRoot '..\CSXS\manifest.xml'
|
||
|
|
if (-not (Test-Path $manifestPath)) {
|
||
|
|
throw "Manifest not found at $manifestPath"
|
||
|
|
}
|
||
|
|
$manifestXml = [xml](Get-Content -Raw -Path $manifestPath)
|
||
|
|
$version = $manifestXml.ExtensionManifest.ExtensionBundleVersion
|
||
|
|
if (-not $version) {
|
||
|
|
throw 'Could not read <ExtensionBundleVersion> from manifest.xml'
|
||
|
|
}
|
||
|
|
Write-Host "Dragonflight Premiere panel - Windows installer build v$version"
|
||
|
|
|
||
|
|
$iscc = Get-Command 'ISCC.exe' -ErrorAction SilentlyContinue
|
||
|
|
if (-not $iscc) {
|
||
|
|
# Common install location if not on PATH.
|
||
|
|
$fallback = "${env:ProgramFiles(x86)}\Inno Setup 6\ISCC.exe"
|
||
|
|
if (Test-Path $fallback) {
|
||
|
|
$iscc = Get-Command $fallback
|
||
|
|
} else {
|
||
|
|
throw "ISCC.exe not found. Install Inno Setup 6: winget install JRSoftware.InnoSetup"
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
$distDir = Join-Path $PSScriptRoot 'dist'
|
||
|
|
New-Item -ItemType Directory -Force -Path $distDir | Out-Null
|
||
|
|
|
||
|
|
& $iscc.Source "/DMyAppVersion=$version" "installer.iss"
|
||
|
|
if ($LASTEXITCODE -ne 0) {
|
||
|
|
throw "ISCC failed with exit code $LASTEXITCODE"
|
||
|
|
}
|
||
|
|
|
||
|
|
$output = Join-Path $distDir "dragonflight-premiere-panel-$version-windows-setup.exe"
|
||
|
|
if (-not (Test-Path $output)) {
|
||
|
|
throw "Expected output not found: $output"
|
||
|
|
}
|
||
|
|
$size = [math]::Round((Get-Item $output).Length / 1KB, 1)
|
||
|
|
Write-Host "Built $output ($size KB)"
|