Skip to content

Instantly share code, notes, and snippets.

@rockpapergoat
Created July 16, 2012 19:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rockpapergoat/3124538 to your computer and use it in GitHub Desktop.
Save rockpapergoat/3124538 to your computer and use it in GitHub Desktop.
resolve missing bundle identifier issues by adding them to plists
#!/usr/bin/env ruby
# 2012-07-16, resolve missing bundle identifier issues by adding them to plists
# add your problem pkg receipts and values to the hash below.
identifiers = {
"vpnclient-api.pkg" => "com.cisco.vpnclient-api",
"vpnclient-bin.pkg" => "com.cisco.vpnclient-bin",
"vpnclient-kext.pkg" => "com.cisco.vpnclient-kext",
"vpnclient-profiles.pkg" => "com.cisco.vpnclient-profiles",
"vpnclient-startup.pkg" => "com.cisco.vpnclient-startup",
"vpnclient-gui.pkg" => "com.cisco.vpnclient-gui",
"Flip4Mac Web Plugins.pkg" => "net.telestream.flip4macwebplugins",
"Flip4Mac QuickTime Components.pkg" => "net.telestream.flip4macqtcomponents",
"PGP.pkg" => "com.pgp.pgp"
}
def fix_receipts(receipts)
path = "/Library/Receipts"
if receipts.is_a?(Hash)
receipts.each_pair do |k,v|
if File.exists?("#{path}/#{k}")
puts "fixing #{k}"
%x(/usr/bin/defaults write #{path}/\"#{k}\"/Contents/Info CFBundleIdentifier #{v})
end
end
end
end
fix_receipts(identifiers)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment