ZIPPED OS X files are corrupted

asked 14 Sep '11, 05:50

Jake's gravatar image

Jake ♦♦
accept rate: 98%

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 recommend 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 decompress 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/</programArguments> <workingDirectory>/some/folder</workingDirectory> </runProgram>

The open command will re-populate the resource forks so they will be again available as /rsrc. Be careful though that the "open" command returns control immediately after invocation, so you would need to place a (wait five seconds) action after the mentioned (of course you can customize the wait interval to a safe value, in case you have a big file that takes time to uncompress). That way the uncompressed file will be fully available after the wait.

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


answered 14 Sep '11, 06:01

Jake's gravatar image

Jake ♦♦
accept rate: 98%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 14 Sep '11, 05:50

Seen: 1,876 times

Last updated: 14 Sep '11, 06:09