Jump to content

Recommended Posts

Posted

Hi all,

 

I want to do two things...

 

1 - Combine multiple packages into one package (i.e. install multiple pieces of software with one installer). Can I do this with PackageMaker?

 

2 - Add icons to the dock as part of the installer package. (i.e. If I install Word I want the Word icon in the dock after install is complete)

 

Any suggestions on how to go about this?

 

thanks!

Posted

So I've made some progress on this...

 

I can accomplish #1 with an .mpkg and I can do #2 with a script. However, the issue I'm running in to is that, when I run the script as postinstall or postflight at the end of the package, it is run as root and, therefore, does not have any effect on the individual's dock.

 

Any thoughts on how I can get that final script to run as the USER even though the package is run as root?

 

Thanks!

Posted

So I finally figured out how to do this, and I'll post my findings here in case anyone else is interested.

 

To run the script as the user and make changes to the current user's dock, I used the following:

 

----

 

#!/bin/sh

 

sudo -u $USER defaults write $HOME/Library/Preferences/com.apple.dock persistent-apps -array-add "tile-datafile-data_CFURLString/Path/to/Application_CFURLStringType0"

 

killall Dock

 

exit 0

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...