cyaconi
cyaconi

Reputation: 121

Cocoa - How to copy files to /usr/share?

I'm developing an "installation" like cocoa application wich needs to take care of some http request, some file system reading, copying files to /usr/share, set up cron (not launchd) and ask some information to user. I discarded PackageMaker since I need more flexibility.

Currently everything is going well, but on my last installation step, I need to:

It's very important that /usr/share/MY_APP keeps protected with administrative privileges, so a regular shouldn't delete it.

What would be the best approach to implement those steps?

BTW, I'm using Xcode 3.2.

Thanks a lot! Carlos.

Upvotes: 1

Views: 745

Answers (1)

Peter Hosey
Peter Hosey

Reputation: 96323

Between the preflight script, the postflight script, and perhaps an Installer plug-in for the custom UI, I see no reason why you can't do all of this in PackageMaker.

Note: “Installer plug-in” is a little misleading. The user does not have to install the plug-in somewhere as a separate step; you include the plug-in inside your package, and Installer will use it from there.

The relevant document is a ReadMe file in a sample code project. There's also an Installer plug-in project template in Xcode since 2.0.

Also, an Installer plug-in won't get used if the user does a command-line installation. Of course, they can't install from the command line at all (which includes remote installation onto an office or lab full of machines) if you write your own custom installer.

By the way: Why /usr/share? What are you putting there? There may be a better way to do what you're really trying to accomplish.

Upvotes: 2

Related Questions