From bf892e2035ab5ac7ed43062ef0ca995568e8dae6 Mon Sep 17 00:00:00 2001 From: Greg Neagle Date: Thu, 4 Sep 2025 10:26:53 -0700 Subject: [PATCH] Attempt to sign app Content/Frameworks only if that dir exists --- code/tools/make_swift_munki_pkg.sh | 31 ++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/code/tools/make_swift_munki_pkg.sh b/code/tools/make_swift_munki_pkg.sh index 154592d9..42630b5b 100755 --- a/code/tools/make_swift_munki_pkg.sh +++ b/code/tools/make_swift_munki_pkg.sh @@ -612,19 +612,26 @@ if [ "$APPSIGNINGCERT" != "" ]; then exit 2 fi - echo "Signing MunkiStatus.app Frameworks..." - /usr/bin/find "$APPROOT/Applications/Managed Software Center.app/Contents/Helpers/MunkiStatus.app/Contents/Frameworks" -type f -perm -u=x -exec /usr/bin/codesign -f -s "$APPSIGNINGCERT" --options runtime --timestamp --verbose {} \; - SIGNING_RESULT="$?" - if [ "$SIGNING_RESULT" -ne 0 ]; then - echo "Error signing MunkiStatus.app Frameworks: $SIGNING_RESULT" - exit 2 + # Frameworks may or may not exist depending on OS target and linked Frameworks + if [ -e "$APPROOT/Applications/Managed Software Center.app/Contents/Helpers/MunkiStatus.app/Contents/Frameworks" ] ; then + echo "Signing MunkiStatus.app Frameworks..." + /usr/bin/find "$APPROOT/Applications/Managed Software Center.app/Contents/Helpers/MunkiStatus.app/Contents/Frameworks" -type f -perm -u=x -exec /usr/bin/codesign -f -s "$APPSIGNINGCERT" --options runtime --timestamp --verbose {} \; + SIGNING_RESULT="$?" + if [ "$SIGNING_RESULT" -ne 0 ]; then + echo "Error signing MunkiStatus.app Frameworks: $SIGNING_RESULT" + exit 2 + fi fi - echo "Signing Managed Software Center.app Frameworks..." - /usr/bin/find "$APPROOT/Applications/Managed Software Center.app/Contents/Frameworks" -type f -perm -u=x -exec /usr/bin/codesign -f -s "$APPSIGNINGCERT" --options runtime --timestamp --verbose {} \; - SIGNING_RESULT="$?" - if [ "$SIGNING_RESULT" -ne 0 ]; then - echo "Error signing Managed Software Center.app Frameworks: $SIGNING_RESULT" - exit 2 + + # Frameworks may or may not exist depending on OS target and linked Frameworks + if [ -e "$APPROOT/Applications/Managed Software Center.app/Contents/Frameworks" ] ; then + echo "Signing Managed Software Center.app Frameworks..." + /usr/bin/find "$APPROOT/Applications/Managed Software Center.app/Contents/Frameworks" -type f -perm -u=x -exec /usr/bin/codesign -f -s "$APPSIGNINGCERT" --options runtime --timestamp --verbose {} \; + SIGNING_RESULT="$?" + if [ "$SIGNING_RESULT" -ne 0 ]; then + echo "Error signing Managed Software Center.app Frameworks: $SIGNING_RESULT" + exit 2 + fi fi echo "Signing Managed Software Center.app..."