From 5c23cd0b05d563ad49b79dae9eb7df78f7b1f506 Mon Sep 17 00:00:00 2001 From: Renan Date: Mon, 29 Jun 2026 00:12:21 -0300 Subject: [PATCH 1/8] Inline Icon --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 072d49e..e1c7024 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# MkPFS +# MkPFS icon MkPFS [![PyPI](https://img.shields.io/pypi/v/mkpfs?style=flat-square&logo=pypi&logoColor=white&color=2563eb)](https://pypi.org/project/mkpfs/) [![Python 3.8+](https://img.shields.io/badge/python-3.8%2B-2563eb?style=flat-square&logo=python&logoColor=white)](https://www.python.org/downloads/release/python-380/) From 3948a8f073d033873a9ef8a910088ca4e244dcc9 Mon Sep 17 00:00:00 2001 From: Renan Date: Mon, 29 Jun 2026 00:45:03 -0300 Subject: [PATCH 2/8] Better installer --- .github/workflows/ci.yml | 49 +++++++++++++++++++++++++++++-- README.md | 2 +- assets/installer/distribution.xml | 15 ++++++++++ 3 files changed, 62 insertions(+), 4 deletions(-) create mode 100644 assets/installer/distribution.xml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0fefc95..14e1b73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -209,16 +209,59 @@ jobs: chmod +x "dist/MkPFS.app/Contents/MacOS/$exe_name" || true fi fi - # create component package then product package so installer shows proper title/version - # sanitize ART_VERSION for filename use + + # Ensure the generated .icns is embedded in the app bundle and Info.plist points to it + if [ -f "dist/MkPFS.icns" ]; then + mkdir -p dist/MkPFS.app/Contents/Resources || true + cp -f "dist/MkPFS.icns" "dist/MkPFS.app/Contents/Resources/MkPFS.icns" || true + /usr/libexec/PlistBuddy -c "Set :CFBundleIconFile \"MkPFS.icns\"" "$PLIST" || /usr/libexec/PlistBuddy -c "Add :CFBundleIconFile string \"MkPFS.icns\"" "$PLIST" || true + fi + + # create a simple postinstall script that writes a VERSION file into the app bundle + mkdir -p dist/installer-scripts || true + cat > dist/installer-scripts/postinstall <<'POST' + #!/bin/bash + set -e + APP="/Applications/MkPFS.app" + if [ -d "$APP" ]; then + RES="$APP/Contents/Resources" + mkdir -p "$RES" + echo "MkPFS ${ART_VERSION}" > "$RES/VERSION.txt" + chown root:wheel "$RES/VERSION.txt" || true + chmod 644 "$RES/VERSION.txt" || true + fi + exit 0 + POST + chmod +x dist/installer-scripts/postinstall || true + + # create installer resources (welcome, background) and use manifest from assets + mkdir -p dist/installer-resources || true + # prefer a tailored installer background if provided, otherwise fall back to the app icon + if [ -f assets/images/installer-background.png ]; then + cp -f assets/images/installer-background.png dist/installer-resources/background.png || true + elif [ -f assets/images/icon.png ]; then + cp -f assets/images/icon.png dist/installer-resources/background.png || true + fi + if [ -f assets/installer/welcome.rtf ]; then + sed "s/__ART_VERSION__/${ART_VERSION//\//\/}/g" assets/installer/welcome.rtf > dist/installer-resources/welcome.rtf || cp assets/installer/welcome.rtf dist/installer-resources/welcome.rtf || true + fi + + # copy distribution manifest from assets and substitute ART_VERSION placeholder + if [ -f assets/installer/distribution.xml ]; then + mkdir -p dist/installer-resources || true + sed "s/__ART_VERSION__/${ART_VERSION//\//\/}/g" assets/installer/distribution.xml > dist/installer-resources/distribution.xml || cp assets/installer/distribution.xml dist/installer-resources/distribution.xml || true + fi + + # create component package (the raw pkg that installs the .app) ART_FILE_SAFE=$(echo "$ART_VERSION" | tr ' ' '_' | tr -d '()') pkgbuild \ --install-location /Applications \ --component "dist/MkPFS.app" \ --version "${ART_VERSION}" \ --identifier "com.psbrew.mkpfs" \ + --scripts dist/installer-scripts \ dist/mkpfs-component.pkg - productbuild --identifier com.psbrew.mkpfs --version "${ART_VERSION}" --package dist/mkpfs-component.pkg "dist/mkpfs-${ART_FILE_SAFE}-macos-${ARCH}.pkg" || cp dist/mkpfs-component.pkg "dist/mkpfs-${ART_FILE_SAFE}-macos-${ARCH}.pkg" + productbuild --distribution dist/installer-resources/distribution.xml --resources dist/installer-resources "dist/mkpfs-${ART_FILE_SAFE}-macos-${ARCH}.pkg" || cp dist/mkpfs-component.pkg "dist/mkpfs-${ART_FILE_SAFE}-macos-${ARCH}.pkg" rm -f dist/mkpfs-component.pkg || true - name: Build Linux onefile GUI diff --git a/README.md b/README.md index e1c7024..072d49e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# MkPFS icon MkPFS +# MkPFS [![PyPI](https://img.shields.io/pypi/v/mkpfs?style=flat-square&logo=pypi&logoColor=white&color=2563eb)](https://pypi.org/project/mkpfs/) [![Python 3.8+](https://img.shields.io/badge/python-3.8%2B-2563eb?style=flat-square&logo=python&logoColor=white)](https://www.python.org/downloads/release/python-380/) diff --git a/assets/installer/distribution.xml b/assets/installer/distribution.xml new file mode 100644 index 0000000..1da07ce --- /dev/null +++ b/assets/installer/distribution.xml @@ -0,0 +1,15 @@ + + + MkPFS __ART_VERSION__ + + + + + + + + + + + #mkpfs-component.pkg + From 55bb84d05fdf0ae68b747ef9b9e83ccb8ad0490b Mon Sep 17 00:00:00 2001 From: Renan Date: Mon, 29 Jun 2026 00:52:00 -0300 Subject: [PATCH 3/8] installer: use lowercase welcome.rtf and ensure distribution references it --- .github/workflows/ci.yml | 16 +++++++++------- assets/installer/distribution.xml | 1 - assets/installer/welcome.rtf | 18 ++++++++++++++++++ 3 files changed, 27 insertions(+), 8 deletions(-) create mode 100644 assets/installer/welcome.rtf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14e1b73..c84be4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -236,19 +236,16 @@ jobs: # create installer resources (welcome, background) and use manifest from assets mkdir -p dist/installer-resources || true - # prefer a tailored installer background if provided, otherwise fall back to the app icon - if [ -f assets/images/installer-background.png ]; then - cp -f assets/images/installer-background.png dist/installer-resources/background.png || true - elif [ -f assets/images/icon.png ]; then - cp -f assets/images/icon.png dist/installer-resources/background.png || true - fi + # create installer resources directory + mkdir -p dist/installer-resources || true + + # Copy welcome.rtf from assets (inject ART_VERSION) if [ -f assets/installer/welcome.rtf ]; then sed "s/__ART_VERSION__/${ART_VERSION//\//\/}/g" assets/installer/welcome.rtf > dist/installer-resources/welcome.rtf || cp assets/installer/welcome.rtf dist/installer-resources/welcome.rtf || true fi # copy distribution manifest from assets and substitute ART_VERSION placeholder if [ -f assets/installer/distribution.xml ]; then - mkdir -p dist/installer-resources || true sed "s/__ART_VERSION__/${ART_VERSION//\//\/}/g" assets/installer/distribution.xml > dist/installer-resources/distribution.xml || cp assets/installer/distribution.xml dist/installer-resources/distribution.xml || true fi @@ -261,6 +258,11 @@ jobs: --identifier "com.psbrew.mkpfs" \ --scripts dist/installer-scripts \ dist/mkpfs-component.pkg + + # copy the component package into the distribution resources so productbuild can find it by #mkpfs-component.pkg + cp -f dist/mkpfs-component.pkg dist/installer-resources/mkpfs-component.pkg || true + + # build product package using the Distribution XML and the resources directory so the installer UI is customized productbuild --distribution dist/installer-resources/distribution.xml --resources dist/installer-resources "dist/mkpfs-${ART_FILE_SAFE}-macos-${ARCH}.pkg" || cp dist/mkpfs-component.pkg "dist/mkpfs-${ART_FILE_SAFE}-macos-${ARCH}.pkg" rm -f dist/mkpfs-component.pkg || true diff --git a/assets/installer/distribution.xml b/assets/installer/distribution.xml index 1da07ce..800ea83 100644 --- a/assets/installer/distribution.xml +++ b/assets/installer/distribution.xml @@ -1,7 +1,6 @@ MkPFS __ART_VERSION__ - diff --git a/assets/installer/welcome.rtf b/assets/installer/welcome.rtf new file mode 100644 index 0000000..dc0e713 --- /dev/null +++ b/assets/installer/welcome.rtf @@ -0,0 +1,18 @@ +{\rtf1\ansi +{\fs36\b Welcome to MkPFS}\par +{\fs24\i PSBrew}\par +\par +Thank you for choosing MkPFS {\b __ART_VERSION__}.\par +\par +{\b Features:}\par +\pard\li720 +- Create and pack PKG / FFPKG images\par +- Verify and inspect package files\par +- GUI-assisted workflow tailored for macOS\par +\pard\li0 +\par +For source and updates: https://github.com/psbrew/mkpfs\par +Visit: www.psbrew.com\par +\par +Click Continue to install MkPFS.\par +} From 543a12436f6ed3984f632c1afdeb2205b60c80dc Mon Sep 17 00:00:00 2001 From: Renan Date: Mon, 29 Jun 2026 00:54:41 -0300 Subject: [PATCH 4/8] ci: add diagnostics for macOS productbuild distribution synthesis and resource listing --- .github/workflows/ci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c84be4d..1cca90d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -262,6 +262,16 @@ jobs: # copy the component package into the distribution resources so productbuild can find it by #mkpfs-component.pkg cp -f dist/mkpfs-component.pkg dist/installer-resources/mkpfs-component.pkg || true + # Diagnostic: show installer resources and synthesized distribution to help debug "no software to install" errors + echo "--- dist/installer-resources listing ---" + ls -la dist/installer-resources || true + echo "--- distribution.xml ---" + cat dist/installer-resources/distribution.xml || true + echo "--- Attempting productbuild --synthesize (diagnostic) ---" + /usr/bin/productbuild --synthesize --package dist/installer-resources/mkpfs-component.pkg dist/installer-resources/synth_distribution.xml || true + echo "--- synthesized distribution (if produced) ---" + cat dist/installer-resources/synth_distribution.xml || true + # build product package using the Distribution XML and the resources directory so the installer UI is customized productbuild --distribution dist/installer-resources/distribution.xml --resources dist/installer-resources "dist/mkpfs-${ART_FILE_SAFE}-macos-${ARCH}.pkg" || cp dist/mkpfs-component.pkg "dist/mkpfs-${ART_FILE_SAFE}-macos-${ARCH}.pkg" rm -f dist/mkpfs-component.pkg || true From 86078ceeca8241791beb7ee3877ee7b831e296a6 Mon Sep 17 00:00:00 2001 From: Renan Date: Mon, 29 Jun 2026 00:58:21 -0300 Subject: [PATCH 5/8] Better welcome message --- assets/installer/welcome.rtf | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/assets/installer/welcome.rtf b/assets/installer/welcome.rtf index dc0e713..ba8b26d 100644 --- a/assets/installer/welcome.rtf +++ b/assets/installer/welcome.rtf @@ -1,18 +1,18 @@ -{\rtf1\ansi -{\fs36\b Welcome to MkPFS}\par -{\fs24\i PSBrew}\par -\par -Thank you for choosing MkPFS {\b __ART_VERSION__}.\par -\par -{\b Features:}\par -\pard\li720 -- Create and pack PKG / FFPKG images\par -- Verify and inspect package files\par -- GUI-assisted workflow tailored for macOS\par -\pard\li0 -\par -For source and updates: https://github.com/psbrew/mkpfs\par -Visit: www.psbrew.com\par -\par -Click Continue to install MkPFS.\par -} +{\rtf1\ansi\ansicpg1252\cocoartf2870 +\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica-Bold;\f1\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +{\*\expandedcolortbl;;} +\paperw11900\paperh16840\vieww12000\viewh15840\viewkind0 +\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural\partightenfactor0 + +\f0\b\fs36 \cf0 MkPFS +\fs24 __ART_VERSION__. +\f1\b0 \ +\ +\pard\pardeftab720\partightenfactor0 +\cf0 MkPFS is a tool and Python library for building, verifying, inspecting, browsing, and extracting PFS disk images. It works with common image naming conventions such as .ffpfs, .ffpfsc, .pfs, .dat, .exfat, and .bin.\ +\pard\pardeftab720\partightenfactor0 +\cf0 \ +For source and updates: {\field{\*\fldinst{HYPERLINK "https://github.com/psbrew/mkpfs"}}{\fldrslt https://github.com/psbrew/mkpfs}}\ +\ +Click Continue to install MkPFS.} \ No newline at end of file From 8c3aa1aa62cc2ee36945f7174aa72c24bb862bf6 Mon Sep 17 00:00:00 2001 From: Renan Date: Mon, 29 Jun 2026 01:02:05 -0300 Subject: [PATCH 6/8] installer: make choice visible and reference component pkg file to avoid hidden package issue --- assets/installer/distribution.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/assets/installer/distribution.xml b/assets/installer/distribution.xml index 800ea83..262e7a5 100644 --- a/assets/installer/distribution.xml +++ b/assets/installer/distribution.xml @@ -7,8 +7,10 @@ - - + + + mkpfs-component.pkg - #mkpfs-component.pkg + + mkpfs-component.pkg From f5cbfe0a9e3f0c13a5ee261f79e7e5d08328a336 Mon Sep 17 00:00:00 2001 From: Renan Date: Mon, 29 Jun 2026 01:04:24 -0300 Subject: [PATCH 7/8] ci(macos): use --package-path and verify product contains component; fail on tiny product; diagnostics --- .github/workflows/ci.yml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1cca90d..c326204 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -273,7 +273,35 @@ jobs: cat dist/installer-resources/synth_distribution.xml || true # build product package using the Distribution XML and the resources directory so the installer UI is customized - productbuild --distribution dist/installer-resources/distribution.xml --resources dist/installer-resources "dist/mkpfs-${ART_FILE_SAFE}-macos-${ARCH}.pkg" || cp dist/mkpfs-component.pkg "dist/mkpfs-${ART_FILE_SAFE}-macos-${ARCH}.pkg" + # Use --package-path to ensure productbuild can locate and embed the component package from our resources folder + productbuild --distribution dist/installer-resources/distribution.xml --package-path dist/installer-resources --resources dist/installer-resources "dist/mkpfs-${ART_FILE_SAFE}-macos-${ARCH}.pkg" + + # Diagnostic: show the produced product and its size, then attempt to expand it to verify it contains packages + echo "--- dist listing (post-productbuild) ---" + ls -la dist || true + echo "--- produced product file size ---" + stat -f "%N %z bytes" "dist/mkpfs-${ART_FILE_SAFE}-macos-${ARCH}.pkg" || ls -la "dist/mkpfs-${ART_FILE_SAFE}-macos-${ARCH}.pkg" || true + echo "--- du summary ---" + du -sh dist/* || true + + # Try to expand the product package to inspect contents (diagnostic) + TMP_EXPAND_DIR=$(mktemp -d /tmp/mkpfs-expand.XXXX) + echo "Expanding product to $TMP_EXPAND_DIR" + if /usr/bin/pkgutil --expand-full "dist/mkpfs-${ART_FILE_SAFE}-macos-${ARCH}.pkg" "$TMP_EXPAND_DIR"; then + echo "--- expanded product listing ---" + ls -la "$TMP_EXPAND_DIR" || true + else + echo "pkgutil --expand-full failed or product is not expandable" || true + fi + + # Fail fast if produced product looks suspiciously small (< 100KB) + PROD_SIZE=$(stat -f "%z" "dist/mkpfs-${ART_FILE_SAFE}-macos-${ARCH}.pkg" 2>/dev/null || echo 0) + echo "produced product size: $PROD_SIZE" + if [ "$PROD_SIZE" -lt 102400 ]; then + echo "ERROR: produced product pkg is unexpectedly small ($PROD_SIZE bytes). Aborting upload." >&2 + exit 1 + fi + rm -f dist/mkpfs-component.pkg || true - name: Build Linux onefile GUI From dd6c03aa0e0169675c719516fc987333a8e812c6 Mon Sep 17 00:00:00 2001 From: Renan Date: Mon, 29 Jun 2026 01:06:28 -0300 Subject: [PATCH 8/8] installer: ensure choice id matches pkg-ref and use # anchor for component pkg --- assets/installer/distribution.xml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/assets/installer/distribution.xml b/assets/installer/distribution.xml index 262e7a5..8eb1892 100644 --- a/assets/installer/distribution.xml +++ b/assets/installer/distribution.xml @@ -4,13 +4,14 @@ - + - - - mkpfs-component.pkg + + + + #mkpfs-component.pkg - mkpfs-component.pkg + #mkpfs-component.pkg