Skip to content

Instantly share code, notes, and snippets.

@bochoven
Last active June 29, 2017 08:25
Show Gist options
  • Save bochoven/0240cc4533afa873658834975affd88e to your computer and use it in GitHub Desktop.
Save bochoven/0240cc4533afa873658834975affd88e to your computer and use it in GitHub Desktop.
#!/bin/sh
# Script that creates two installer packages with the same destination app
# but different CFBundleIdentifiers.
# These trigger in macOS installer the creation of a .localized version
mkdir -p /tmp/test/Applications/Test.app/Contents
/usr/libexec/plistbuddy -c "Add :CFBundleIdentifier string macadmins.test.1" /tmp/test/Applications/Test.app/Contents/Info.plist
pkgbuild --root /tmp/test /tmp/test.1.pkg
/usr/libexec/plistbuddy -c "Set :CFBundleIdentifier string macadmins.test.2" /tmp/test/Applications/Test.app/Contents/Info.plist
pkgbuild --root /tmp/test /tmp/test.2.pkg
sudo installer -pkg /tmp/test.1.pkg -tgt /
sudo installer -pkg /tmp/test.2.pkg -tgt /
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment