Internal
Public Access
Add Windows installer via Inno Setup
New packaging/windows/orbithub.iss packages the build directory's top-level contents directly (orbithub.exe, *.dll, platforms/, sqldrivers/) rather than going through cmake --install: vcpkg's own applocal DLL deployment already drops every required runtime dependency flat into build/ on every build (confirmed repeatedly this session), and the existing private-runtime-lib install() rule uses an RPATH-style Unix convention (lib/orbithub/) that doesn't work on Windows, where DLLs must sit next to the exe. Produces a single OrbitHub-Setup-<version>.exe with a Start Menu entry, optional desktop shortcut, and uninstaller. build-installer.ps1 reads the project version from build/CMakeCache.txt (same approach build-deb.sh already uses) and drives ISCC.exe. Code signing is out of scope for now (no certificate available), so the installer will trigger a SmartScreen warning until one is purchased. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,36 @@
|
|||||||
|
param(
|
||||||
|
[string]$BuildDir = "$PSScriptRoot\..\..\build",
|
||||||
|
[string]$DistDir = "$PSScriptRoot\..\..\dist\windows"
|
||||||
|
)
|
||||||
|
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
$cacheFile = Join-Path $BuildDir "CMakeCache.txt"
|
||||||
|
if (-not (Test-Path $cacheFile)) {
|
||||||
|
throw "Build directory not configured: $BuildDir (run cmake -S . -B build first)"
|
||||||
|
}
|
||||||
|
|
||||||
|
$versionLine = Select-String -Path $cacheFile -Pattern '^CMAKE_PROJECT_VERSION:STATIC=(.*)$'
|
||||||
|
if (-not $versionLine) {
|
||||||
|
throw "Unable to determine project version from $cacheFile"
|
||||||
|
}
|
||||||
|
$version = $versionLine.Matches[0].Groups[1].Value
|
||||||
|
|
||||||
|
$isccCandidates = @(
|
||||||
|
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe",
|
||||||
|
"C:\Program Files\Inno Setup 6\ISCC.exe",
|
||||||
|
"$env:LOCALAPPDATA\Programs\Inno Setup 6\ISCC.exe"
|
||||||
|
)
|
||||||
|
$iscc = $isccCandidates | Where-Object { Test-Path $_ } | Select-Object -First 1
|
||||||
|
if (-not $iscc) {
|
||||||
|
throw "Inno Setup compiler (ISCC.exe) not found. Install it: winget install -e --id JRSoftware.InnoSetup"
|
||||||
|
}
|
||||||
|
|
||||||
|
New-Item -ItemType Directory -Force -Path $DistDir | Out-Null
|
||||||
|
|
||||||
|
& $iscc "/DMyAppVersion=$version" "$PSScriptRoot\orbithub.iss"
|
||||||
|
if ($LASTEXITCODE -ne 0) {
|
||||||
|
throw "ISCC.exe failed with exit code $LASTEXITCODE"
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Output "Created $DistDir\OrbitHub-Setup-$version.exe"
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
#ifndef MyAppVersion
|
||||||
|
#define MyAppVersion "0.0.0"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define MyAppName "OrbitHub"
|
||||||
|
#define MyAppPublisher "OrbitHub Maintainers"
|
||||||
|
#define MyAppExeName "orbithub.exe"
|
||||||
|
#define MyBuildDir "..\..\build"
|
||||||
|
|
||||||
|
[Setup]
|
||||||
|
AppId={{6B2E0B8F-2C6D-4E7C-9C36-6C6C9C6F6C1A}
|
||||||
|
AppName={#MyAppName}
|
||||||
|
AppVersion={#MyAppVersion}
|
||||||
|
AppPublisher={#MyAppPublisher}
|
||||||
|
DefaultDirName={autopf}\{#MyAppName}
|
||||||
|
DefaultGroupName={#MyAppName}
|
||||||
|
UninstallDisplayIcon={app}\{#MyAppExeName}
|
||||||
|
OutputDir=..\..\dist\windows
|
||||||
|
OutputBaseFilename=OrbitHub-Setup-{#MyAppVersion}
|
||||||
|
Compression=lzma2
|
||||||
|
SolidCompression=yes
|
||||||
|
ArchitecturesAllowed=x64compatible
|
||||||
|
ArchitecturesInstallIn64BitMode=x64compatible
|
||||||
|
SetupIconFile=orbithub.ico
|
||||||
|
WizardStyle=modern
|
||||||
|
DisableProgramGroupPage=yes
|
||||||
|
|
||||||
|
[Languages]
|
||||||
|
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||||
|
|
||||||
|
[Tasks]
|
||||||
|
Name: "desktopicon"; Description: "Create a &desktop shortcut"; GroupDescription: "Additional icons:"; Flags: unchecked
|
||||||
|
|
||||||
|
[Files]
|
||||||
|
Source: "{#MyBuildDir}\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
|
Source: "{#MyBuildDir}\*.dll"; DestDir: "{app}"; Flags: ignoreversion
|
||||||
|
Source: "{#MyBuildDir}\platforms\*"; DestDir: "{app}\platforms"; Flags: ignoreversion recursesubdirs
|
||||||
|
Source: "{#MyBuildDir}\sqldrivers\*"; DestDir: "{app}\sqldrivers"; Flags: ignoreversion recursesubdirs
|
||||||
|
|
||||||
|
[Icons]
|
||||||
|
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
|
||||||
|
Name: "{group}\Uninstall {#MyAppName}"; Filename: "{uninstallexe}"
|
||||||
|
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
|
||||||
|
|
||||||
|
[Run]
|
||||||
|
Filename: "{app}\{#MyAppExeName}"; Description: "Launch {#MyAppName}"; Flags: nowait postinstall skipifsilent
|
||||||
Reference in New Issue
Block a user