how do I set the Creator Code or package info?

I feel like I’m completely missing the boat here and feel stupid even asking this question but I can’t seem to make Xojo set the creator code of an app. No matter what I change my package info file always says “APPL???” this app is old enough that it used to have a creator code! But no more. I didn’t remove it. Changing the package info field in the “shared” tab and that doesn’t seem to actually do anything.

I know that it’s ancient and no longer mostly used, but certain things still complain if it’s not set right. In my app both the PackageInfo file says “APPL???” and the CFBundleSignature in the plist file that is created with the app says just “???”

Where did my creator code go? And can I still enter one or are all apps now built saying they are ??? ?

Creator codes are dead dead dead dead
Not “mostly no longer used” but more like “dead gone buried dont use”

10.6 mostly stopped using them for anything and 10.7 on basically ignore them

Bundle ID is what you should use instead

You’ll have an interest in https://forum.xojo.com/29717-new-file-type-editor-results-in-wrong-or-blank-file-icons/0#p244995
to see how your icons etc are associated with your app

I understand they are dead, I’m not actually using them for anything myself. I have several users talking to my apps directly with some home brew apps written in old versions of both Obj-c and even xojo from back when it was real basic :wink: The apple events that they send are targeted by the creator code and not the bundle ID as is done now days. This seems to still work even in El Capitan if you actually set it. I just want to let people that are sending me apple events from old legacy but still working code of their own to still be able to do so without having to manually go into the bundle and edit my resources each time I release a new version.

I suppose I can script during the build process a defaults write and the copying in of a prepared packageInfo file if thats what I’ve got to do. I was just hoping that I had somehow missed a setting somewhere.

App Wrapper also reports this as an error every time I wrap up the app to get it ready for testing… This isn’t a problem then? Is it still required that we include the CFBundleSignature key in the plist file and the packageInfo file?

Targeting apple events by creator codes - fun
Haven’t done that in a while since you can use the bundle id instead
I’ve done that to talk to BBEdit

Creator code is literally gone from the IDE because its not used
So you will probably have to set the PkgInfo with a custom code and a build step

[quote=245014:@James Sentman]
App Wrapper also reports this as an error every time I wrap up the app to get it ready for testing… [/quote]
Reports “this” ? Whats “this” ?
That the PkgInfo has no creator code or ???

you can use the freeware quickchange for that purpose
http://www.everydaysoftware.net/quickchange/

app wrapper doesn’t like the ??? as the value, it tells me this every time I wrap an app. I just compiled an empty project to see if I only have this old dead data in there because these project files are so old that the values are still in there somewhere, but xojo creates the packageInfo file and adds the CFBundleSignature both set to ??? even in a brand new app. Should that just be removed then? At the moment if I add a CFBundleSignature to my additional info.plist file it is NOT carried across to the compiled app but is overridden with the ???. If the IDE stopped adding ??? then perhaps I could add this to my info.plist file and it would come across? Then adding a copy step for the packetInfo file would be easy. Or is there a reason why that needs to be there and set to ??? for new apps still? I would guess that leaving it out entirely would be the thing to do if it was no longer used rather than forcing it to ???.

The compiler spits that file out but I dont believe it reads the plist to garner the right value

Weird part is that its not used - but its still required to be present regardless of the value in it

A copy file step would let you overwrite whats generated

The CFBundleSignature seems to be in limbo. While the documentation doesn’t state that it should be there or recommended, it does state that it should be unique. It’s not needed anymore that you and I can agree on.
https://developer.apple.com/library/mac/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102193

As for the PkgInfo file, I recall reading recently that this is optional… Ah yes…
https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/ConfigApplications.html

Interesting as the second document states that the CFBundleSignature should be in the plist.

The message that App Wrapper reports isn’t that helpful; you can add your own code on the Info pane of the application, CFBundleSignature is the key. Just keep it to 4 characters.

In the mean time, I’ll have a poke at Apple’s apps to see what they do.

I could also get App Wrapper to auto generate a 4 char string, based upon the bundle identifier.

Here Apples apps have a unique code in there (sfri, emal, etc)
So it seems Apples unclear advice isn’t that useful or followed by them (how lovely and unsurprising)

I suppose if its set app wrapper could pull CFBundleSignature out & stick it in the pkginfo file
However that wont help folks who want to generate a Mac app from Windows or Linux that has it set unless they wrap the app

I’ll prod Joe & see if he has any flashes of brilliance about this
A copy file step with an 8 byte file set up as “APPLxxxx” where xxxx is the 4 char creator code would suffice on all targets
I just tried it and it does work if you copy to the Contents dir

Interestingly enough this is the first time anyones even mentioned the PkgInfo file since we made this change in 2014 :stuck_out_tongue:

[quote=245252:@Norman Palardy]Here Apples apps have a unique code in there (sfri, emal, etc)
So it seems Apples unclear advice isn’t that useful or followed by them (how lovely and unsurprising)[/quote]
IIRC in the old days, 3rd party devs were prohibited from using lower case characters.
Apple: Do as I say, not as I do.
Point in case, their own apps that ship with the OS do not adhere to the code signing rules!

App Wrapper currently doesn’t know about PkgInfo files (I haven’t told it about them yet), so it only pays attention to the “CFBundleSignature” plist entry.

But it is something that I could teach it about.

I’m thinking right now, that if this field is set to “???” or doesn’t exist, it auto generates it based upon the bundle identifier, as it can be manually added via the “Info” pane of App Wrapper.

I guess the next step is to teach it to make sure the PkgInfo matches.

[quote=245254:@Sam Rowlands]IIRC in the old days, 3rd party devs were prohibited from using lower case characters.
Apple: Do as I say, not as I do.[/quote]

They only reserved all-lowercase creator codes and types. I think that’s a perfectly reasonable trade off given the limitations of the time.

If it’s hard coded to ??? then what is the “package Info” field in the shared tab of the build information section of a project? I’ve tried putting different things in there but it doesn’t seem to change anything. I know there is an application class property that returns that, is that just so you can put some info in there that you might want to retrieve from the app class in runtime?

Its not that - as you’ve discovered
IF it existed in the IDE it would be on the OS X tab

It may be one that is no longer used in building for any platform

Holy COW you really are not only going x-plat, but x-species!

I seem to recall that was for Windows.

If you want to get the BundleSignature at run time, I can whip up some declares for you.

Is there already a solution for this problem?

this still works in 10.9
http://www.everydaysoftware.net/quickchange/
don’t know for more recent OS

In my programs I save text file using “Stream.Write MyText” and I set MyFile.MacCreator and MyFile.MacType .
I disabled those lines using ’ .
When I search my creator code in Xojo IDE, it found constant App.MacCreator = “PGsr” (my creator code) and Build Automation.Mac OS X.Creator Code = “PGsr” .

How can I remove them ? And if I wanted to change them ? Usually when we click in the search result list, it bring us to the good place, but not it those case.

Or should I replace my code “PGsr” by “???” ?

Edit : I read the link gaved by Norman and then the Xojo Help File Types. I loose my documents icon after removed the MacCreator of the document file but it came back when I set my application according to the Xojo hep page.

Thank you for the links.