Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

At the moment, if I create a TAR or ZIP file foo.tar - containing multiple files and directories - when I double click on the archive it creates a folder foo containing all of the archived items.

Is there a way to have an archive extract itself - when opened from Finder - so that the files are at the same level as the archive was?

I'm trying to distribute an archive which users can use to setup a USB drive with a custom icon etc, however this requires copying hidden files into the USB drive's root, so I can't just get them to "copy/paste from this network directory"

share|improve this question

Unless I am mistaken (always a possibility), this behavior is set by the program extracting the archive file, not by the archive file itself.

share|improve this answer
Do you know of any archivers which do work in the way I'm hoping? – Gareth Aug 24 '11 at 17:11
It wouldn't really matter, because it's up to the unarchiver. You would need to get people to install an unarchiver, and possibly set its preferences, before they extracted your archive. Which sounds like more trouble than it's worth. – Adam Rice Aug 24 '11 at 17:23

The way I would do this is:

  1. Create your .zip file, with the desired USB drive contents.
  2. Create an applescript named USB Drive Installer or whatever:

    tell application "Finder" to get folder of (path to me) as Unicode text
    set myDir to POSIX path of result
    set DestinationDirectory to choose folder with prompt "Select USB Drive Destination"
    do shell script "/usr/bin/ditto -xk " & myDir & "/" & quoted form of DestinationDirectory
  3. Create another .zip with those two files. Provide instructions to run the applescript after the files are extracted.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.