• 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
open package installer in bundle resources directory not working
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

open package installer in bundle resources directory not working


  • Subject: open package installer in bundle resources directory not working
  • From: Denis Bohm <email@hidden>
  • Date: Fri, 12 Dec 2008 18:48:16 -0800

I'm trying to distribute an installer within my own application bundle in the resources directory and run it from my application. When I try to run it from the debugger I get the error "launch path not accessible". However, if I then use the terminal to run the command by hand using the same path it works.

Anyone have any idea why it fails to run it from the application?



Code in my application:

NSTask* task = [[NSTask alloc] init];
NSString* path = [[NSBundle mainBundle] pathForResource:@"FTDIUSBSerialDriver" ofType:@"pkg"];
NSLog(path);
[task setArguments: [NSArray arrayWithObjects: @"/usr/bin/open", path, nil]];
[task launch];


Output from the debugger when it fails:

2008-12-12 18:34:15.179 Firefly Upload Center[3364:813] /Users/denis/ sandbox/firefly/design/device/upload/mac/UploadCenter/build/Debug/ Firefly Upload Center.app/Contents/Resources/FTDIUSBSerialDriver.pkg
(gdb) continue
Current language: auto; currently objective-c
Firefly Upload Center: unexpected exception: NSInvalidArgumentException: launch path not accessible
-[NSConcreteTask launchWithDictionary:] (in Foundation) + 2490
-[NSConcreteTask launch] (in Foundation) + 41
-[FDApplication applicationDidFinishLaunching:] (in Firefly Upload Center) (FDApplication.m:67)
_nsnote_callback (in Foundation) + 364
__CFXNotificationPost (in CoreFoundation) + 362
_CFXNotificationPostNotification (in CoreFoundation) + 179
-[NSNotificationCenter postNotificationName:object:userInfo:] (in Foundation) + 128
-[NSNotificationCenter postNotificationName:object:] (in Foundation) + 56
-[NSApplication _postDidFinishNotification] (in AppKit) + 125
-[NSApplication _sendFinishLaunchingNotification] (in AppKit) + 77
-[NSApplication(NSAppleEventHandling) _handleAEOpen:] (in AppKit) + 284
-[NSApplication(NSAppleEventHandling) _handleCoreEvent:withReplyEvent:] (in AppKit) + 98
-[NSAppleEventManager dispatchRawAppleEvent:withRawReply:handlerRefCon:] (in Foundation) + 655


This works from the command line:

open "/Users/denis/sandbox/firefly/design/device/upload/mac/ UploadCenter/build/Debug/Firefly Upload Center.app/Contents/Resources/ FTDIUSBSerialDriver.pkg"

_______________________________________________

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


  • Follow-Ups:
    • Re: open package installer in bundle resources directory not working
      • From: Mark Allan <email@hidden>
  • Prev by Date: Re: Announce the time every 30 minutes
  • Next by Date: how to let the NSOutlineview to display the line number?
  • Previous by thread: Funky behavior with layer-backed views
  • Next by thread: Re: open package installer in bundle resources directory not working
  • Index(es):
    • Date
    • Thread