• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: zipping like Archive Utility
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: zipping like Archive Utility


  • Subject: Re: zipping like Archive Utility
  • From: Matt Gough <email@hidden>
  • Date: Tue, 27 Jul 2010 16:31:23 +0100

On 27 Jul 2010, at 16:05:19, Jean-Daniel Dupas wrote:

>
> Le 27 juil. 2010 à 16:56, Tito Ciuro a écrit :
>
>> Hi Matt,
>>
>> On 27/07/2010, at 07:43, Matt Gough wrote:
>>
>>> I am automating my build process so that my built Installer package gets zipped up before uploading to a web site. Previously I have manually used Finder's Compress option to do this (which goes via Archive Utility)
>>>
>>> I tried just using zip, but that gave substantially larger archive sizes.
>>> I can't do it via 'open -a 'Archive Utility' <ThingToCompress>' as the script it is running from won't have a usable WindowServer at the time.
>>>
>>> The closest  (in size) that I have got is:
>>>
>>> tar -zcf "My Installer.zip" "My Installer.mpkg"
>>>
>>> However whilst the resultant file can be expanded via Archive Utility, attempting to get Safari to decompress it after download results in a "Decompression failed" error.
>>>
>>> Any ideas?
>>
>> Perhaps using ditto?:
>>
>> ditto -c -k -X --rsrc --sequesterRsrc <fullSourcePath> <fullTargetPath>
>
>
> That's it. I know I read this somewhere before. From ditto man page:
>
> The command:
>           ditto -c -k --sequesterRsrc --keepParent src_directory archive.zip
>     will create a PKZip archive similarly to the Finder's Compress functionality.
>
>

Getting so close.

Unfortunately, "My Installer.mpkg" has a custom icon. Although ditto correctly preserves the associated icon file, when expanding the archive, the custom icon bit is not set. If I put the Installer inside a folder and ditto that, it does get preserved but you end up with an extra folder level.

The solution is:

1. Create a new folder  tmp
2. Copy the Installer into tmp
3. Make sure there is NOTHING ELSE in tmp (e.g .DS_Store files)
4. use ditto without the --keepParent option
	ditto -c -k --sequesterRsrc  tmp "My Installer.zip"

This seems to satisfy all my requirements.

Thanks to all who helped

Matt _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >zipping like Archive Utility (From: Matt Gough <email@hidden>)
 >Re: zipping like Archive Utility (From: Tito Ciuro <email@hidden>)
 >Re: zipping like Archive Utility (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: zipping like Archive Utility
  • Next by Date: Re: Xcode 4 preview
  • Previous by thread: Re: zipping like Archive Utility
  • Next by thread: Re: zipping like Archive Utility
  • Index(es):
    • Date
    • Thread