diff --git a/scripts/macosx/pkg_arm64.sh b/scripts/macosx/pkg_arm64.sh index 37321ff..709b1c3 100755 --- a/scripts/macosx/pkg_arm64.sh +++ b/scripts/macosx/pkg_arm64.sh @@ -138,6 +138,39 @@ productbuild \ echo "PKG package created: ${PKG_NAME}" +# Set custom icon for PKG file +if [ -f "${ICON_PATH}" ]; then + echo "Setting custom icon for PKG file..." + # Create a temporary iconset from icns + TEMP_ICON_DIR=$(mktemp -d) + cp "${ICON_PATH}" "${TEMP_ICON_DIR}/icon.icns" + + # Use sips to create a png from icns for the icon + sips -s format png "${TEMP_ICON_DIR}/icon.icns" --out "${TEMP_ICON_DIR}/icon.png" 2>/dev/null || true + + # Method: Use osascript to set file icon (works on macOS) + osascript </dev/null || true + + # Method: Use osascript to set file icon (works on macOS) + osascript <