We help IT Professionals succeed at work.

Mac Installer Pkg

infinitusagnitio
on
1,179 Views
Last Modified: 2013-11-25
Hi,

So I'm just starting working on Mac development, and I'm trying to write a simple app where basically you click on a .dmg or .pkg (basically any installer file) and the installer opens up then copies a directory of files to the user's desktop.  Is there an easy way to accomplish this in Xcode, or could someone point me in the right direction of relevant resources?

Thanks in advance.
Comment
Watch Question

Eoin OSullivanConsultant
CERTIFIED EXPERT
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Eoin OSullivanConsultant
CERTIFIED EXPERT

Commented:
You can get a bit more information here
http://s.sudre.free.fr/Stuff/PackageMaker_Howto.html
and on the Apple Developer website
http://developer.apple.com/documentation/Darwin/Reference/Manpages/man1/packagemaker.1.html

You might also want to look at ICEBERG - an alternative tool
http://s.sudre.free.fr/Software/Iceberg.html


Author

Commented:
Thanks man, I'll take a look at these and post back here! :)

Author

Commented:
Hi,

So I looked at those links, but I seem to be running into a simple roadblock.  I have the .pkg file I created and it's installing files, but I can't get it to install those files to a dynamic user home directory (I guess packagemaker lacks that variable).  I've been reading around online, and it seems like the solution is to write the root folder of the pkg (we'll call it MyRoot) to something like /private/var/tmp, and then write a postflight perl script (or another kind?) to copy the files to the user's home directory.  

Is this a good approach, and if so what is the variable in perl for homefolder (username)?
Eoin OSullivanConsultant
CERTIFIED EXPERT

Commented:
Sorry. But your question was about installers. If you want to get into the mechanics of the installation process then please open another EE question to address it specifically.

There are several ways to perform a user specific install. You may have seen installers that prompt you whether you want to install in a user folder or root folder. See installers for screensavers or system preference panes for examples
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Eoin OSullivanConsultant
CERTIFIED EXPERT

Commented:
I'm delighted you answered the second question for yourself. I refer to your ORIGINAL question.
I pointed you at some "relevant resources" i.e. PackageMaker etc.
I am sorry if you feel hard-done-by but it is the weekend and I don't have time to explore the detail of the second part of your question. You seem to have resolved it in any case.
Eoin OSullivanConsultant
CERTIFIED EXPERT

Commented:
I object to the close if there is a refund. Either close with partial points or close with no refund.

Author

Commented:
I gave you partial points for your original answer.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.