Reputation: 210
I'm creating a Cocoa Mac OS X app to install printers using a NSTask and the lpadmin command. I want to be able to use the .ppd files that are bundled with my application, e.g.
lpadmin -p name -E -v lpd://printer-location.com/public hp-laserjet-9050.ppd -L place
How can I do this where the (.ppd) file is located in my application bundle? Should I just write the file to the current directory, install, and then delete it?
Upvotes: 0
Views: 212
Reputation: 27073
Add File.ppd
to the "Supporting Files" folder (Xcode 4 screenshot):
Run lpadmin
through NSTask
using the following file path:
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"File" ofType:@"ppd" inDirectory:nil];
Upvotes: 2