diff --git a/build-windows.sh b/build-windows.sh index 790c461..379177c 100755 --- a/build-windows.sh +++ b/build-windows.sh @@ -62,14 +62,17 @@ echo "==> Bundling MinGW runtime + transitive dependencies" # repeat a few passes so transitive deps (incl. those of the deployed plugins) # are all picked up. ( cd "$DIST_DIR" + # Disable strict mode here: once everything is copied, grep finds no new + # /mingw64 deps and returns 1, which would otherwise abort the whole script. + set +e +o pipefail for _ in $(seq 1 6); do - find . \( -name '*.exe' -o -name '*.dll' \) -print0 \ + deps="$(find . \( -name '*.exe' -o -name '*.dll' \) -print0 \ | xargs -0 -I{} ldd "{}" 2>/dev/null \ | grep -io '/mingw64/bin/[^ ]*\.dll' \ - | sort -u \ - | while read -r f; do - [ -e "./$(basename "$f")" ] || cp "$f" . - done + | sort -u)" + for f in $deps; do + [ -e "./$(basename "$f")" ] || cp "$f" . + done done ) diff --git a/installer.nsi b/installer.nsi index e175743..b1af592 100644 --- a/installer.nsi +++ b/installer.nsi @@ -14,8 +14,12 @@ Unicode true !include "MUI2.nsh" +; Anchor all source paths to this script's own directory so makensis works +; regardless of the current working directory it is invoked from. +!define ROOT "${__FILEDIR__}" + Name "${APPNAME}" -OutFile "UltimateMediaTracker-Setup.exe" +OutFile "${ROOT}\UltimateMediaTracker-Setup.exe" InstallDir "$PROGRAMFILES64\${APPNAME}" InstallDirRegKey HKLM "Software\${APPNAME}" "InstallDir" RequestExecutionLevel admin @@ -27,8 +31,8 @@ VIAddVersionKey "FileVersion" "${VERSION}" VIAddVersionKey "FileDescription" "${APPNAME} Installer" VIAddVersionKey "LegalCopyright" "${COMPANY}" -!define MUI_ICON "resources\icons\appicon.ico" -!define MUI_UNICON "resources\icons\appicon.ico" +!define MUI_ICON "${ROOT}\resources\icons\appicon.ico" +!define MUI_UNICON "${ROOT}\resources\icons\appicon.ico" !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_DIRECTORY @@ -45,7 +49,9 @@ VIAddVersionKey "LegalCopyright" "${COMPANY}" Section "Install" SetOutPath "$INSTDIR" - File /r "${SOURCEDIR}\*.*" + ; "\*" (not "*.*") also grabs extensionless files and all subfolders + ; (platforms\, tls\, sqldrivers\, imageformats\, iconengines\ ...). + File /r "${ROOT}\${SOURCEDIR}\*" ; Shortcuts CreateDirectory "$SMPROGRAMS\${APPNAME}"