Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- TempDir="/tmp/pkg"
- AppPath=$1
- TargetPath=$2
- PackageIdentifier=$3
- Certificate=$4
- if [ $# -ne 3 ]
- then
- echo "Usage: $0 <AppPath> <TargetPath> <PackageIdentifier> <CertificateCommonName or CertificateChecksum>"
- exit 1
- fi
- rm -rf ${TempDir}
- mkdir -p ${TempDir}
- mkdir -p ${TargetPath}
- cp -r ${AppPath} ${TempDir}
- cd /tmp
- pkgbuild --analyze --root ${TempDir} package.plist
- pkgbuild --root ${TempDir} --component-plist package.plist --identifier ${PackageIdentifier} package.pkg
- productbuild --synthesize --package package.pkg packageDistribution.xml
- productbuild --distribution ./packageDistribution.xml --package-path . InstallerPackage.pkg
- productsign --timestamp=none --sign "$Certificate" InstallerPackage.pkg SignedInstallerPackage.pkg
- rm package.plist
- rm package.pkg
- rm packageDistribution.xml
- rm -rf ${TempDir}
- mv SignedInstallerPackage.pkg ${TargetPath}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement