rinkplanner/tools/export_windows_installer.sh
torsten e28f8976f2 feat: Windows-Installer-Pipeline (NSIS, per-user)
- tools/setup_windows_installer.sh richtet NSIS lokal ohne Root ein
- tools/export_windows_installer.sh baut die EXE und
  build/windows/rinkplanner-setup.exe; --no-export nutzt die vorhandene EXE
- tools/windows_installer.nsi: per-user Installation nach
  %LOCALAPPDATA%\Programs\Rinkplanner, Startmenü-/Desktop-Verknüpfung,
  Uninstaller, keine Adminrechte
- tools/make_windows_icon.py erzeugt das Installer-Icon aus app_icon.png
- docs/builds.md und AGENTS.md dokumentieren Pipeline und aktuelle
  Website-Struktur (Subdomain als einzige Seite)
2026-11-10 17:09:11 +01:00

64 lines
1.8 KiB
Bash
Executable file

#!/usr/bin/env bash
# Baut den Windows-Installer (per-user, ohne Administratorrechte).
#
# Aufruf:
# ./tools/export_windows_installer.sh # EXE neu bauen + Installer
# ./tools/export_windows_installer.sh --no-export # nur Installer aus vorhandener EXE
#
# Ausgabe: build/windows/rinkplanner-setup.exe
set -euo pipefail
source "$(dirname "${BASH_SOURCE[0]}")/_export_common.sh"
NO_EXPORT=0
if [[ "${1:-}" == "--no-export" ]]; then
NO_EXPORT=1
fi
EXE="$REPO_ROOT/build/windows/rinkplanner.exe"
SETUP="$REPO_ROOT/build/windows/rinkplanner-setup.exe"
ICON="$REPO_ROOT/build/windows/rinkplanner.ico"
if [[ "$NO_EXPORT" -eq 0 || ! -f "$EXE" ]]; then
"$REPO_ROOT/tools/export_windows.sh"
fi
python3 "$REPO_ROOT/tools/make_windows_icon.py"
MAKENSIS="${MAKENSIS:-}"
if [[ -z "$MAKENSIS" ]]; then
if command -v makensis >/dev/null; then
MAKENSIS="$(command -v makensis)"
elif [[ -x "$HOME/.local/share/rinkplanner-toolchain/makensis" ]]; then
MAKENSIS="$HOME/.local/share/rinkplanner-toolchain/makensis"
fi
fi
if [[ -z "$MAKENSIS" ]]; then
echo "makensis nicht gefunden. Zuerst ./tools/setup_windows_installer.sh ausführen." >&2
exit 1
fi
# Version aus dem Windows-Export-Preset (application/product_version).
VERSION="$(
sed -n 's/^[[:space:]]*application\/product_version="\([^"]*\)"/\1/p' \
"$PROJECT_DIR/export_presets.cfg" | head -1
)"
VERSION="${VERSION:-0.1.0.0}"
if [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
VERSION="$VERSION.0"
fi
"$MAKENSIS" -V2 -INPUTCHARSET UTF8 \
-DAPP_VERSION="$VERSION" \
-DSOURCE_EXE="$EXE" \
-DOUT_FILE="$SETUP" \
-DICON_FILE="$ICON" \
"$REPO_ROOT/tools/windows_installer.nsi"
if [[ ! -f "$SETUP" ]]; then
echo "Installer wurde nicht erzeugt: $SETUP" >&2
exit 1
fi
ls -lh "$SETUP"
echo "Installer: $SETUP"