1 comment

  • Avatar

    A resource fork is a construction of the Mac OS operating system used to store information in a specific form, such as icons, the shapes of windows, definitions of menus and their contents, and application code (machine code).

    Mac OS X ignores resource forks when copying files over a non-Mac filesystem. You will not be able to create installers that pack files that contain resource forks from another non-Mac operating system. For instance, you cannot build your installers from Windows and expect to preserve the resource forks. This is not a limitation of InstallBuilder, but of the underlying filesystem. Even inside OS X there are some command line utilities that are not resource-fork aware and can inadvertently remove them (such as mv and cp in pre-10.4).

    As long as the application to package does not contain resource forks you can build it from a Windows platform or another non-Mac platform.

    A number of tools can help you in case you need to build your installers for Mac OS X with files that contain resource forks from a non-Mac system:

    1. You can use the OS X ditto command tool to compress the archives in CPIO format or PKZip and use ditto again to uncompress them at installation time (ditto is guaranteed to be always present):

    a. Compress your files in Zip format:

          ditto -c -k --sequesterRsrc --keepParent yourfiles

    b. Include the following piece of code in your XML project file for uncompressing them on installation time: <runProgram> <program>ditto</program> <programArguments>-x -k -rsrcFork ${installdir}/ ${installdir}</programArguments> </runProgram>

    2. Also you can split the files that contain resources into a different format using the tool /Developer/Tools/SplitForks. This files can be packed into the installer in any operating system. Then you can use its counterpart, FixupResourceForks, to recombine the files on installation time. These tools, howerver, are not always guaranteed to be present.

    Additional information can be found in the links below:

Please sign in to leave a comment.