Some checks are pending
CI / Integration (mcr.microsoft.com/mssql/server:2019-latest) (push) Blocked by required conditions
CI / Integration (mcr.microsoft.com/mssql/server:2022-latest) (push) Blocked by required conditions
CI / Build og unit tests (push) Waiting to run
CI / MSI-installer (push) Blocked by required conditions
CI / Integration (mcr.microsoft.com/mssql/server:2017-latest) (push) Blocked by required conditions
CI / Integration (mcr.microsoft.com/mssql/server:2025-latest) (push) Blocked by required conditions
installer/SQLInsight.wxs (WiX 3 syntax) builds on Linux with wixl (installer/build-msi.sh) and in Forgejo CI on every v* tag. Agent and Web are installed self-contained as Windows services under virtual service accounts (or a gMSA), with a settings page in the wizard or MSI properties for silent installs; the values go to sqlinsight.ini, read after appsettings.json. The data folder is locked to SYSTEM, Administrators and the agent account, the event log source is registered, the web port is opened in the firewall, and the automatic update task is an optional feature. Upgrades happen in place, keep edited settings and the chosen features; uninstall keeps the settings. msi-tables.py writes what wixl lacks (component and feature conditions, Permanent/NeverOverwrite, vital services, REG_EXPAND_SZ) and verify-msi.py checks the result (sequencing, deferred actions, ASCII only). test-msi-wine.sh runs install, upgrade and uninstall under Wine. Installations made with the MSI get new versions as MSI packages run by the update task, so Windows Installer stays in charge of the files. The example instance is removed from the shipped appsettings.json, and the CLI writes UTF-8 to the console. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E3EExwndy8Z22EK2Qpt6BK
51 lines
2.6 KiB
Bash
Executable file
51 lines
2.6 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Builds dist/SQLInsight-Pro-<version>-x64.msi on Linux with wixl (apt install wixl).
|
|
# installer/build-msi.sh 1.2.0
|
|
# The programs are published self-contained for win-x64, so the servers need no .NET runtime.
|
|
set -euo pipefail
|
|
|
|
VERSION="${1:-1.0.0}"
|
|
# Windows Installer only knows numeric versions (major.minor.build): 1.3.0-preview.1 is installed as 1.3.0.
|
|
MSI_VERSION="${VERSION%%[-+]*}"
|
|
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
|
OUT="$ROOT/artifacts/msi"
|
|
PUBLISH="$OUT/publish"
|
|
DIST="$ROOT/dist"
|
|
|
|
command -v wixl >/dev/null || { echo "wixl mangler: apt install wixl" >&2; exit 1; }
|
|
# wixl writes a codepage-neutral database, where only ASCII is safe: keep installer texts in English/ASCII.
|
|
if LC_ALL=C grep -n '[^ -~ ]' "$ROOT/installer/SQLInsight.wxs" "$ROOT/installer/SettingsDlg.wxs"; then
|
|
echo "installer/SQLInsight.wxs må kun indeholde ASCII (se linjerne ovenfor)" >&2; exit 1
|
|
fi
|
|
rm -rf "$OUT" && mkdir -p "$PUBLISH" "$DIST"
|
|
|
|
for app in Agent Web; do
|
|
dotnet publish "$ROOT/src/SQLInsight.$app" -c Release -r win-x64 --self-contained true \
|
|
-p:Version="$VERSION" -p:DebugType=none -p:GenerateDocumentationFile=false -o "$PUBLISH/$app" --nologo -v quiet
|
|
done
|
|
|
|
# One component per file. The exe (service key path) and appsettings.json (kept on upgrade) are authored by hand.
|
|
harvest() {
|
|
local app="$1" dir="$2" group="$3"
|
|
(cd "$PUBLISH" && find "$app" -type f \
|
|
! -name "SQLInsight.$app.exe" ! -name "appsettings.json" ! -name "appsettings.*.json" | sort) \
|
|
| wixl-heat --prefix "$app/" --directory-ref "$dir" --component-group "$group" --var "var.${app}Dir" --win64 \
|
|
| sed -E "s/Id=\"(cmp|fil|dir)/Id=\"\1${app}/g" \
|
|
> "$OUT/$app.wxs"
|
|
}
|
|
harvest Agent AGENTDIR AgentFiles
|
|
harvest Web WEBDIR WebFiles
|
|
|
|
# wixl cannot parse component conditions; they (and Permanent/NeverOverwrite) are written into the MSI afterwards.
|
|
python3 "$ROOT/installer/msi-tables.py" strip "$ROOT/installer/SQLInsight.wxs" "$OUT/SQLInsight.wxs"
|
|
MSI="$DIST/SQLInsight-Pro-$VERSION-x64.msi"
|
|
cd "$ROOT/installer"
|
|
wixl --arch x64 --ext ui \
|
|
-D Win64=yes -D Version="$MSI_VERSION" -D AgentDir="$PUBLISH/Agent" -D WebDir="$PUBLISH/Web" -D InstallerDir="$ROOT/installer" \
|
|
-o "$MSI" "$OUT/SQLInsight.wxs" "$ROOT/installer/SettingsDlg.wxs" "$OUT/Agent.wxs" "$OUT/Web.wxs" 2> >(grep -v "has no property named" >&2)
|
|
python3 "$ROOT/installer/msi-tables.py" apply "$ROOT/installer/SQLInsight.wxs" "$MSI"
|
|
# SQLInsight artwork instead of the default dialog pictures.
|
|
msibuild "$MSI" -a Binary.WixUI_Bmp_Dialog "$ROOT/installer/dialog.bmp" -a Binary.WixUI_Bmp_Banner "$ROOT/installer/banner.bmp"
|
|
|
|
python3 "$ROOT/installer/verify-msi.py" "$MSI"
|
|
echo "$MSI"
|