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?
Add
File.ppdto the “Supporting Files” folder (Xcode 4 screenshot):Run
lpadminthroughNSTaskusing the following file path: