From 5d1e1b5667e7141e36c0b701a01759d0af590f6e Mon Sep 17 00:00:00 2001 From: dijunkun Date: Wed, 26 Nov 2025 16:11:49 +0800 Subject: [PATCH] [fix] remove permissions on uninstall and request permissions during installation for MacOS --- scripts/macosx/pkg_arm64.sh | 10 +++++----- scripts/macosx/pkg_x64.sh | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) mode change 100644 => 100755 scripts/macosx/pkg_x64.sh diff --git a/scripts/macosx/pkg_arm64.sh b/scripts/macosx/pkg_arm64.sh index 379ee35..0d7d05d 100644 --- a/scripts/macosx/pkg_arm64.sh +++ b/scripts/macosx/pkg_arm64.sh @@ -86,9 +86,9 @@ pkgbuild \ --component "${APP_BUNDLE}" \ build_pkg_temp/${APP_NAME}-component.pkg -mkdir -p scripts +mkdir -p build_pkg_scripts -cat > scripts/postinstall <<'EOF' +cat > build_pkg_scripts/postinstall <<'EOF' #!/bin/bash USER_HOME=$( /usr/bin/stat -f "%Su" /dev/console ) HOME_DIR=$( /usr/bin/dscl . -read /Users/$USER_HOME NFSHomeDirectory | awk '{print $2}' ) @@ -101,14 +101,14 @@ cp -R "/Library/Application Support/CrossDesk/certs/"* "$DEST/" exit 0 EOF -chmod +x scripts/postinstall +chmod +x build_pkg_scripts/postinstall pkgbuild \ --root "${CERTS_SOURCE}" \ --identifier "${IDENTIFIER}.certs" \ --version "${APP_VERSION}" \ --install-location "/Library/Application Support/CrossDesk/certs" \ - --scripts scripts \ + --scripts build_pkg_scripts \ build_pkg_temp/${APP_NAME}-certs.pkg productbuild \ @@ -118,7 +118,7 @@ productbuild \ echo "PKG package created: ${PKG_NAME}" -rm -rf build_pkg_temp scripts ${APP_BUNDLE} +rm -rf build_pkg_temp build_pkg_scripts ${APP_BUNDLE} echo "PKG package created successfully." echo "package ${APP_BUNDLE}" diff --git a/scripts/macosx/pkg_x64.sh b/scripts/macosx/pkg_x64.sh old mode 100644 new mode 100755 index eccd731..2e9b941 --- a/scripts/macosx/pkg_x64.sh +++ b/scripts/macosx/pkg_x64.sh @@ -86,9 +86,9 @@ pkgbuild \ --component "${APP_BUNDLE}" \ build_pkg_temp/${APP_NAME}-component.pkg -mkdir -p scripts +mkdir -p build_pkg_scripts -cat > scripts/postinstall <<'EOF' +cat > build_pkg_scripts/postinstall <<'EOF' #!/bin/bash USER_HOME=$( /usr/bin/stat -f "%Su" /dev/console ) HOME_DIR=$( /usr/bin/dscl . -read /Users/$USER_HOME NFSHomeDirectory | awk '{print $2}' ) @@ -101,14 +101,14 @@ cp -R "/Library/Application Support/CrossDesk/certs/"* "$DEST/" exit 0 EOF -chmod +x scripts/postinstall +chmod +x build_pkg_scripts/postinstall pkgbuild \ --root "${CERTS_SOURCE}" \ --identifier "${IDENTIFIER}.certs" \ --version "${APP_VERSION}" \ --install-location "/Library/Application Support/CrossDesk/certs" \ - --scripts scripts \ + --scripts build_pkg_scripts \ build_pkg_temp/${APP_NAME}-certs.pkg productbuild \ @@ -118,7 +118,7 @@ productbuild \ echo "PKG package created: ${PKG_NAME}" -rm -rf build_pkg_temp scripts ${APP_BUNDLE} +rm -rf build_pkg_temp build_pkg_scripts ${APP_BUNDLE} echo "PKG package created successfully." echo "package ${APP_BUNDLE}"