I'm trying to register a document file type for my OS X app. First, I added the CFBundleDocumentTypes
and UTExportedTypeDeclarations
keys as described by this answer on adding file type associations. However, Finder didn't seem to want to recognize my declared file type.
In order to figure out what was going on, I turned to this answer on debugging file type associations, which described how I could use the lsregister
tool in the Terminal to find out why it's not working. Whenever I try that, I get the following error:
Signature mismatch: PkgInfo signature = '????', plist CFBundleSignature = 'SWCC'
This seems to be referring to the following line in my Info.plist file:
<key>CFBundleSignature</key>
<string>SWCC</string>
As I understand, CFBundleSignature is analogous to the "creator code" for Mac OS 9. Basically, I just picked a random 4 letter extension for this.
However, I'm not finding anything on what "PkgInfo signature" is or how to declare it. In fact, after an extensive google search, all I could find was about how it was optional since 10.3, without actually getting a description of what it was.
So how can I resolve this problem with a "signature mismatch"?
After a bit more searching, I discovered that a number of apps, including newly created projects in XCode, have the following value in their Info.plist file for CFBundleSignature
:
<key>CFBundleSignature</key>
<string>????</string>
This seems to indicate that the bundle's signature is undefined. Given that CFBundleSignature
seems to be a throwback to Mac OS 9 and the four letter "SWCC" was arbitrarily picked anyway, there should be no harm whatsoever in just changing that line in the Info.plist file to match the above.
After fixing that, the "signature mismatch" error from lsregister should go away and the file type association should be registered if there are no further errors.