From 99ede2446936f3a15c83c1b7e994c002f697ca1f Mon Sep 17 00:00:00 2001 From: Dain Nilsson Date: Mon, 24 Jun 2024 15:23:31 +0200 Subject: [PATCH] Add MacOS PKG preinstall script --- resources/macos/make_pkg.sh | 2 +- resources/macos/pkg_scripts/preinstall | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100755 resources/macos/pkg_scripts/preinstall diff --git a/resources/macos/make_pkg.sh b/resources/macos/make_pkg.sh index b9bc5efe..1d12f294 100755 --- a/resources/macos/make_pkg.sh +++ b/resources/macos/make_pkg.sh @@ -26,7 +26,7 @@ mkdir -p pkg/root/usr/local/bin pkg/comp cp -r $SOURCE_DIR pkg/root/usr/local/ (cd pkg/root/usr/local/bin && ln -s ../ykman/ykman) -pkgbuild --root="pkg/root" --identifier "com.yubico.yubikey-manager" --version "$RELEASE_VERSION" "pkg/comp/ykman.pkg" +pkgbuild --root="pkg/root" --scripts="pkg_scripts" --identifier "com.yubico.yubikey-manager" --version "$RELEASE_VERSION" "pkg/comp/ykman.pkg" productbuild --package-path "pkg/comp" --distribution "distribution.xml" "$PKG" diff --git a/resources/macos/pkg_scripts/preinstall b/resources/macos/pkg_scripts/preinstall new file mode 100755 index 00000000..5d0603a4 --- /dev/null +++ b/resources/macos/pkg_scripts/preinstall @@ -0,0 +1,4 @@ +#!/bin/sh + +# Delete existing installation +rm -rf /usr/local/ykman