diff --git a/docs/builds.md b/docs/builds.md index ed9e136..9d82401 100644 --- a/docs/builds.md +++ b/docs/builds.md @@ -32,10 +32,19 @@ Weitergeben). `build/` ist nicht versioniert. ./tools/export_macos.sh ``` -**Windows:** Icon und Versionsinformationen sind deaktiviert -(`application/modify_resources=false`), damit der Export ohne `rcedit` auf -Linux läuft. Wer das will, installiert `rcedit` und schaltet die Option im -Preset ein. +**Windows:** Die .exe enthält Icon, Produktname, Beschreibung und Version. +Godot bettet sie mit `rcedit` ein; auf Linux läuft `rcedit` über ein +portables Wine. Einmalig einrichten (kein Root nötig): + +```bash +./tools/setup_windows_export.sh +``` + +Das Skript lädt Wine (Kron4ek-Build) und `rcedit` nach +`~/.local/share/rinkplanner-toolchain`, legt einen Wrapper an und trägt ihn +als `export/windows/rcedit` in die Godot-Editor-Settings ein. Die Werte +selbst stehen im Preset unter `application/*` (Icon `app_icon.png`, +Version `0.1.0.0`). **macOS:** Das Bundle ist ad-hoc signiert, aber **nicht notarisiert**. Beim ersten Start auf einem Mac: diff --git a/rinkplanner/export_presets.cfg b/rinkplanner/export_presets.cfg index e79fbe9..8bbe85e 100644 --- a/rinkplanner/export_presets.cfg +++ b/rinkplanner/export_presets.cfg @@ -62,15 +62,15 @@ codesign/timestamp_server_url="" codesign/digest_algorithm=1 codesign/description="" codesign/custom_options=PackedStringArray() -application/modify_resources=false -application/icon="" +application/modify_resources=true +application/icon="res://assets/icons/app_icon.png" application/console_wrapper_icon="" application/icon_interpolation=4 -application/file_version="" -application/product_version="" +application/file_version="0.1.0.0" +application/product_version="0.1.0.0" application/company_name="" application/product_name="Rinkplanner" -application/file_description="2D-Whiteboard fuer Eiskunstlauf" +application/file_description="2D-Whiteboard für Eiskunstlauf" application/copyright="" application/trademarks="" application/export_angle=0 diff --git a/tools/setup_windows_export.sh b/tools/setup_windows_export.sh new file mode 100755 index 0000000..7ed2573 --- /dev/null +++ b/tools/setup_windows_export.sh @@ -0,0 +1,93 @@ +#!/usr/bin/env bash +# Richtet rcedit für Windows-Exporte auf Linux ein. +# +# Godot bettet Icon, Versionsinfo und Produktdaten in die .exe ein, indem es +# rcedit aufruft. rcedit ist ein Windows-Programm; auf Linux läuft es über ein +# portables Wine (kein Root nötig). +# +# Aufruf: +# ./tools/setup_windows_export.sh +# +# Danach den Windows-Build neu erzeugen: +# ./tools/export_windows.sh +set -euo pipefail + +TOOLCHAIN="${TOOLCHAIN:-$HOME/.local/share/rinkplanner-toolchain}" +WINE_VERSION="${WINE_VERSION:-11.20}" +RCEDIT_VERSION="${RCEDIT_VERSION:-2.0.0}" +WINE_URL="https://github.com/Kron4ek/Wine-Builds/releases/download/${WINE_VERSION}/wine-${WINE_VERSION}-amd64.tar.xz" +RCEDIT_URL="https://github.com/electron/rcedit/releases/download/v${RCEDIT_VERSION}/rcedit-x64.exe" + +log() { printf '\n==> %s\n' "$*"; } +command -v curl >/dev/null || { echo "Fehlt: curl" >&2; exit 1; } +command -v tar >/dev/null || { echo "Fehlt: tar" >&2; exit 1; } +command -v python3 >/dev/null || { echo "Fehlt: python3" >&2; exit 1; } + +mkdir -p "$TOOLCHAIN" + +if compgen -G "$TOOLCHAIN/wine-*/bin/wine" >/dev/null; then + log "Wine vorhanden: $(ls -d "$TOOLCHAIN"/wine-*/bin/wine | head -1)" +else + log "Lade portables Wine $WINE_VERSION" + curl -fL --retry 3 -o "$TOOLCHAIN/wine.tar.xz" "$WINE_URL" + tar -xf "$TOOLCHAIN/wine.tar.xz" -C "$TOOLCHAIN" + rm -f "$TOOLCHAIN/wine.tar.xz" +fi + +if [[ -f "$TOOLCHAIN/rcedit-x64.exe" ]]; then + log "rcedit vorhanden" +else + log "Lade rcedit $RCEDIT_VERSION" + curl -fL --retry 3 -o "$TOOLCHAIN/rcedit-x64.exe" "$RCEDIT_URL" +fi + +log "Schreibe Wrapper $TOOLCHAIN/rcedit" +cat > "$TOOLCHAIN/rcedit" <<'WRAPPER' +#!/usr/bin/env bash +set -euo pipefail +TOOLCHAIN="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +WINE_BIN="$(ls -d "$TOOLCHAIN"/wine-*/bin/wine | head -1)" +export WINEPREFIX="${WINEPREFIX:-$TOOLCHAIN/wineprefix}" +export WINEDEBUG="${WINEDEBUG:--all}" +exec "$WINE_BIN" "$TOOLCHAIN/rcedit-x64.exe" "$@" \ + 2> >(grep -vE "libEGL|pci id|egl: failed" >&2) +WRAPPER +chmod +x "$TOOLCHAIN/rcedit" + +log "Initialisiere Wine-Prefix (einmalig)" +WINEPREFIX="$TOOLCHAIN/wineprefix" WINEDEBUG=-all \ + "$(ls -d "$TOOLCHAIN"/wine-*/bin/wine | head -1)" --version >/dev/null + +log "Trage rcedit in die Godot-Editor-Settings ein" +python3 - "$TOOLCHAIN/rcedit" <<'PY' +import pathlib +import re +import shutil +import sys + +wrapper = sys.argv[1] +patched = 0 +for path in sorted((pathlib.Path.home() / ".config" / "godot").glob("editor_settings-4.*.tres")): + text = path.read_text() + shutil.copy2(path, path.with_suffix(path.suffix + ".bak")) + line = f'export/windows/rcedit = "{wrapper}"' + if re.search(r'^export/windows/rcedit = .*$', text, flags=re.M): + text = re.sub(r'^export/windows/rcedit = .*$', line, text, flags=re.M) + else: + text = text.rstrip() + "\n" + line + "\n" + path.write_text(text) + print(f" {path}") + patched += 1 +if patched == 0: + print(" keine passende editor_settings-4.*.tres gefunden") +PY + +log "Fertig" +cat <