The knowledge base is no longer actively updated, we have moved all content to our Community Support Forum
ZIPPED OS X files are corrupted
| Author: BitRock Support Date: February 25, 2009 12:50 Tags: |
Actions
Tips OS X Native Packaging |
The problem is related to the resource forks of the file that has been compressed. In OS X, the resource forks are saved under a hidden file called <filename>/rsrc, but when zipping the file, OS X silently stores the resource forks inside the zip under a folder named "__MACOSX". The problem is that you can't recover the resource forks in other operating systems, nor you can do it in OS X 10.3 or earlier using the regular "unzip" command line tool (10.4 or later do support resource forks in unzip). What we recomend you to do is either to:
- Do not zip the original file. InstallBuilder will take care of the resource forks, populating them in OS X in a transparent way. Also, as you know InstallBuilder has ZIP compression, so you gain very little by already having the file zip-compressed.
- If you still want to preserve the file zipped, when you uncompress the file in the <postInstallationActionList>, do it through a "open" command instead of an "unzip" command, like the following:
<runProgram> <program>open</program> <programArguments>/some/folder/your.zip</programArguments> <workingDirectory>/some/folder</workingDirectory> </runProgram> |
The open command will re-populate the resource forks so they will be again available as
Note as well that we have set the <workingDirectory> element, so the .zip file will be uncompressed in the same folder where it resides.
See also the related Mac OS X resource forks article