Files
LlamaCasty/scripts/package-msix.sh
T
gramps abfab25685 build: the exe is LlamaCasty.exe, and the publish script proves the artifact
Renames AssemblyName to LlamaCasty before the first Steam depot — Steamworks is explicit
that renaming a live exe is painful, so this had to land first, not later.

Four assembly-qualified pack URIs carried the old name, not three: MainWindow (window
icon), OverlayHost (logo), RenameRecordingDialog and KeepBroadcastDialog. Pack URIs
resolve by assembly name at runtime, so a stale one compiles, passes every test and then
silently renders nothing the first time that view opens. AssemblyIdentityTests guards
both halves — the assembly name, and no source XAML still naming the legacy assembly.
Packaging/Package.appxmanifest and package-msix.sh carry the exe name too.

scripts/publish.sh replaces the by-hand publish: single-file win-x64, ReadyToRun,
ffmpeg beside the exe, and it refuses to finish if ffmpeg, LICENSE, PRIVACY.md or
THIRD-PARTY-NOTICES.txt are missing, or if a test assembly leaked in.

That last guard exists because the first publish was wrong in a way no test could see:
PublishSingleFile + IncludeNativeLibrariesForSelfExtract bundled the libav*.dll family
into the exe — a 9-file output with no ffmpeg folder and a 182 MB binary, so the locator
would have found nothing at runtime. ExcludeFromSingleFile="true" on the content keeps
the folder a folder. Diffing against a control publish without the single-file flags
found it; guessing at item globs wasted two attempts first (recorded in MyMistakes.md).

Measured: 127 MB exe + 129 MB ffmpeg = 257 MB depot. Tests: AssemblyIdentity,
StorePackaging, BuildStamp, BundledFonts all pass; app builds with 0 warnings.
2026-11-01 07:01:50 -08:00

70 lines
2.8 KiB
Bash

#!/usr/bin/env bash
# Build the Microsoft Store MSIX package (TASK 48 item 2).
#
# scripts/package-msix.sh
#
# Publishes the app self-contained for win-x64 (so the package carries its own .NET
# runtime and the ONLY native folders are win-x64 — a RID-less publish copies every
# ONNX Runtime native folder), stages the manifest + logos from Packaging/, and packs
# with the Windows SDK's makeappx.
#
# The result is UNSIGNED (the Store signs the submitted package). To produce a package
# you can install locally for testing, point MSIX_PFX at a self-signed .pfx:
#
# MSIX_PFX=/path/to/dev.pfx MSIX_PFX_PASSWORD=... scripts/package-msix.sh
#
# ⚠️ Before a real submission: set Identity/@Publisher and Properties/P
# PublisherDisplayName in Packaging/Package.appxmanifest to the exact values Partner
# Center shows, and bump Identity/@Version. A mismatch is a certification rejection.
set -euo pipefail
REPO_WSL="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
REPO_WIN="$(wslpath -w "$REPO_WSL")"
DOTNET="/mnt/c/Program Files/dotnet/dotnet.exe"
STAGE_WSL="$REPO_WSL/artifacts/msix-stage"
OUT_WSL="$REPO_WSL/artifacts/LlamaCasty.msix"
MAKEAPPX="$(ls -d "/mnt/c/Program Files (x86)/Windows Kits/10/bin/"*/x64/makeappx.exe 2>/dev/null \
| sort -V | tail -1 || true)"
SIGNTOOL="$(ls -d "/mnt/c/Program Files (x86)/Windows Kits/10/bin/"*/x64/signtool.exe 2>/dev/null \
| sort -V | tail -1 || true)"
[ -x "$MAKEAPPX" ] || { echo "makeappx.exe not found — install the Windows 10/11 SDK." >&2; exit 1; }
echo "== publish (Release, win-x64, self-contained) =="
rm -rf "$STAGE_WSL"
mkdir -p "$STAGE_WSL"
"$DOTNET" publish "$REPO_WIN\\ytLive.csproj" \
-c Release -r win-x64 --self-contained true \
--nologo -v minimal \
-o "$(wslpath -w "$STAGE_WSL")"
[ -f "$STAGE_WSL/LlamaCasty.exe" ] || { echo "publish produced no LlamaCasty.exe" >&2; exit 1; }
[ -d "$STAGE_WSL/ffmpeg" ] || {
echo "ffmpeg/ is missing from the package — it must ship bundled (Store policy 10.2.2)." >&2
exit 1
}
echo "== stage the manifest + logos =="
cp "$REPO_WSL/Packaging/Package.appxmanifest" "$STAGE_WSL/AppxManifest.xml"
cp -r "$REPO_WSL/Packaging/Assets" "$STAGE_WSL/Assets"
echo "== pack =="
"$MAKEAPPX" pack /d "$(wslpath -w "$STAGE_WSL")" /p "$(wslpath -w "$OUT_WSL")" /o
if [ -n "${MSIX_PFX:-}" ]; then
[ -x "$SIGNTOOL" ] || { echo "signtool.exe not found — install the Windows 10/11 SDK." >&2; exit 1; }
echo "== sign =="
if [ -n "${MSIX_PFX_PASSWORD:-}" ]; then
"$SIGNTOOL" sign /fd SHA256 /a /f "$(wslpath -w "$MSIX_PFX")" /p "$MSIX_PFX_PASSWORD" \
"$(wslpath -w "$OUT_WSL")"
else
"$SIGNTOOL" sign /fd SHA256 /a /f "$(wslpath -w "$MSIX_PFX")" "$(wslpath -w "$OUT_WSL")"
fi
else
echo "note: unsigned package (the Store signs submissions); set MSIX_PFX to sign locally."
fi
echo
echo "MSIX: $OUT_WSL ($(du -h "$OUT_WSL" | cut -f1))"