diff --git a/docker/windows/package.sh b/docker/windows/package.sh index 0bf9a58..34193fb 100755 --- a/docker/windows/package.sh +++ b/docker/windows/package.sh @@ -13,8 +13,15 @@ set -euo pipefail HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO="$(cd "${HERE}/../.." && pwd)" -TARGET="${CARGO_TARGET_DIR:-${REPO}/target}/x86_64-pc-windows-gnu/release" -OUT="${OUT:-${CARGO_TARGET_DIR:-${REPO}/target}/installer}" +# Absolute, whatever CARGO_TARGET_DIR was. NSIS on a POSIX host translates +# the backslashes in `${STAGE}\LICENSE` only when it can tell the path is a +# POSIX one, which it decides from a leading `/`; a relative `target-windows` +# — which is exactly what CI sets — reaches it as a name with a literal +# backslash in it and "LicenseData: open failed". The first CI run died there, +# after every step before it had passed. +TARGET_DIR="$(realpath -m "${CARGO_TARGET_DIR:-${REPO}/target}")" +TARGET="${TARGET_DIR}/x86_64-pc-windows-gnu/release" +OUT="$(realpath -m "${OUT:-${TARGET_DIR}/installer}")" EXE="${TARGET}/darkroom-desktop.exe" [[ -f "${EXE}" ]] || { echo "error: ${EXE} not built" >&2; exit 1; } @@ -56,6 +63,10 @@ for dir in face scene; do done echo "==> staged $(ls "${STAGE}/models" | wc -l) model file(s)" +# One installer in the output directory, the one just built. The directory +# is cached between CI runs, so after a version bump a glob over it would find +# two and the smoke test would hand Wine both names as one path. +rm -f "${OUT}"/DarkRoom-*-x86_64-setup.exe INSTALLER="${OUT}/DarkRoom-${VERSION}-x86_64-setup.exe" # NSIS wants Windows-style paths in File directives even on a POSIX host, and # the script takes its inputs by define so nothing about the layout here is