So, to start things going again… I was looking at my RSS feeds for the first time in almost 5 months, and read Dan Wood of Karelia fame explaining about Converting Rich Text to TEXT/styl resources for an SLA on a Disk Image.
My own workflow for building a release disk image uses a small tool I’ve written for that. You can download it here. Here’s the help text it prints out if you run it without arguments:
Add one license at a time to a (unflattened) disk image.
Usage: AddLicense /path/to/TheUnflattened.dmg Language /path/to/TheLicense.rtf
Languages supported: da nl ko ja fr it fi pt sv en es de nb
You can also use long equivalents like English, French etc.
The first language added will be the default language (usually English).
Here's an actual usage example from a build script:
hdiutil unflatten "$SOURCE_ROOT/My.dmg"
"$BUILT_PRODUCTS_DIR/AddLicense" "$SOURCE_ROOT/My.dmg" English "$SOURCE_ROOT/EnglishLicense.rtf"
"$BUILT_PRODUCTS_DIR/AddLicense" "$SOURCE_ROOT/My.dmg" French "$SOURCE_ROOT/FrenchLicense.rtf"
hdiutil flatten "$SOURCE_ROOT/My.dmg"
and I use the “flatten” and “unflatten” arguments to hdiutil to massage the disk image.
The trick (as Dan points out in his post update) is that you can use ‘RTF ‘ resources instead of TEXT/styl. I received this interesting tidbit through oral tradition; I’m not a 100% certain, but I think it was through some code that Marko Karppinen showed me a few years ago. Pass it on.
If there’s interest, I may clean up and publish the source sometime, though it uses all sort of gronky old APIs (Resource Manager etc.).
Update: the link above now downloads the complete Xcode project. I also included it on my source code page.