Skip to content

Commit 2df0799

Browse files
committed
now deals better with missing CFBundleName keys
1 parent b553a43 commit 2df0799

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ However, there are situations where `autopkg` does not work well. The most commo
5656

5757
`quickpkg` is meant for 'quick' packaging. No configuration, no options. Download the application from the AppStore or the dmg or zip from the web and go. (I started working on it because I could never remember the exact options needed for `pkgbuild`.) [`munki-pkg`](https://github.com/munki/munki-pkg/) is a tool that makes it easier to access the complex options of `pkgbuild` and `packagebuild`, but it still supports complex projects.
5858

59-
If you prefer a UI rather than a command line tool, then use [Stephan Sudre's Packages](http://s.sudre.free.fr/Software/Packages/about.html).
59+
If you prefer a UI rather than a command line tool, then use [Stéphane Sudre's Packages](http://s.sudre.free.fr/Software/Packages/about.html).
6060

6161
## Warning
6262

quickpkg

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,16 @@ def appNameAndVersion(app_path):
157157
# TODO: cleanup volumes here
158158
cleanup_and_exit(1)
159159
info_plist = plistlib.readPlist(info_path)
160-
app_name = info_plist.get("CFBundleName", None)
161-
app_identifier = info_plist.get("CFBundleIdentifier", None)
162-
app_version = info_plist.get("CFBundleShortVersionString", None)
160+
app_name = info_plist.get("CFBundleName")
161+
if app_name is None:
162+
app_name = info_plist.get("CFBundleDisplayName")
163+
if app_name is None:
164+
(app_name, app_ext) = os.path.splitext(os.path.basename(app_path))
165+
#app_name = info_plist.get("CFBundleExecutable")
166+
app_identifier = info_plist.get("CFBundleIdentifier")
167+
app_version = info_plist.get("CFBundleShortVersionString")
163168
if app_version is None:
164-
app_version = info_plist.get("CFBundleVersion", None)
169+
app_version = info_plist.get("CFBundleVersion")
165170
return (app_name, app_identifier, app_version)
166171

167172

0 commit comments

Comments
 (0)