• 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: 'ditto' troubles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'ditto' troubles


  • Subject: Re: 'ditto' troubles
  • From: Greg Guerin <email@hidden>
  • Date: Tue, 23 Feb 2010 15:37:04 -0700

Steve Cronin wrote:

At the time the user requests I initiate an NSTask and deploy:
NSTask *unzipTask=[[NSTask alloc] init];
[unzipTask setLaunchPath:@"/usr/bin/ditto"];
[unzipTask setArguments:[NSArray arrayWithObjects:@"-x",@"- k",sourcePath,targetPath,nil]];


The problem is that the deployed Helper file has the 'X' icon and displays the "application is damaged.." message.

If I take the Helper.zip file from the 'contents' and manually double click it then the decompression works fine….

I'm so close and just I can't see what's stopping this deployment.
Is there a ditto flag I need to set that I'm not seeing?

I have seen this problem before in a similar situation. At the time, my diagnosis was that the Finder was seeing the top-level .app dir created, and it looked inside for a Contents/Info.plist etc. before the de-archiving was complete. As a result, Finder's first impression is that the app is incomplete (damaged), and it then takes some work to convince Finder to reverse that opinion. IIRC, I had to trick Finder.


One way was to de-archive to a folder not named "Something.app", but instead just use "Something". Then after the de-archiving finished, rename the dir to "YourApp.app". I even used a temp name that starts with ".", which Finder won't show.

Another way is to trick Finder into re-reading the bundle's contents, by modifying the top-level ".app" folder's mod-date. I did this by creating and then removing a temp file, but you could also set mod- date directly. I just found it easier to create & remove a file, because this was all done in a shell script.

I don't recall which one worked, or worked better, or on which OS versions, so I suggest running a few experiments.

You could also probably fix the problem using the Launch Services API, or running the lsregister command. If you'd rather avoid kluges or magic tricks.

  -- GG

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: High Level Toolkit -- is it obsolete or not?
  • Next by Date: iPhone app to Flash over wifi
  • Previous by thread: Re: 'ditto' troubles
  • Next by thread: Sheet not appearing normally...the first time
  • Index(es):
    • Date
    • Thread