Showing results for 
Search instead for 
Did you mean: 
Level 8
Report Inappropriate Content
Message 1 of 2

include agent in deploystudio workflow? create custom pkg?

Hey all, I am not finding much info on packaging the script.  I tried following a process very similar to the steps below, but my install keeps failing (no errors that lead to anything, just a generic 'installation failed' message).  Any ideas?  I'm wondering if this is caused by the script that calls on not running with sudo privilege?

Ultimately my goal is simply to include the agent in a DeployStudio workflow.  If you have a suggestion, please let me know!

Pulled from another thread:

  1. When you first open PackageMaker, the first thing prompted is the "Install Properties" dialog.  This is up to you on what to put for your organization, but it is looking for something similar to "com.mycompany" (essentially like a domain name backwards).  This is just what will be used to identify these packages as made for your organization.  You then select what the minimum version of Mac OS X that the package can be run on.  Click OK.
  2. With PackageMaker's main window open, either drag from within Finder in to the "Contents" section on the left, or press the "+" button on the bottom left to add the file via an "Open" dialog.
  3. Now, you should see a little tree view under the Contents section with the top being a little blue dot with the word "install" next to it, and the branch below with "install" as well with a "/" to indicate where the file will "install" to when the package is launched (This is what I step)
  4. Now, click on the "install" branch with the "/" underneath, and you will see the dialog on the right change.  Under the "Configuration" section, select a "Destination" for the file to be copied to when the package is run (again, I chose /Library/MyCompany/).
  5. Under the same area, you will notice that the Package Identifier should show "com.mycompany.install.pkg".  You can change the install.pkg to anything that makes sense to you.  I put "com.mycompany.McAfeeAgent.4.patch2.install" (really does not matter I don't think).  I left the version as 1.0, and made sure that the checkbox for "Require admin authentication" was checked.
  6. Click on the "Content" button next to "Configuration".  Change the owner to "root", and the group to "admin", and at the bottom (this works, but may not be necessary exactly), change the permissions on the file to 755 (i.e Owner:RWX, Group:RX, and Other:RX), and click on "Include root in package" (not sure this is needed either, but it seems to work)
  7. Now, leave PackageMaker up, and open up your favorite text editor (I use TextWrangler or XCode myself).  You are going to create a whole other shell script to call the script.  Here is what I simply put for mine (this can obviously be expanded greatly to include checks and balances, but this gives you the idea of how to simply install.  Also, you notice I am not using sudo in the commands. This is due to the script being run as an admin, as was ensured in step 5):


    # Install McAfee Agent 4.0 w/patch 2
    /Library/MyCompany/ -i

    # Remove the file when the install is complete
    rm -f /Library/MyCompany/

  8. After saving the file (I saved mine as, head back in to PackageMaker.  Click on the "Scripts" header next to "Components" and next to the "Postinstall" field, either type in the location to the shell script you just created, or select the button next to the field to choose the location where it is.
  9. For all intents and purposes, that is it.  You can build it and run it, and it will install the agent without having someone run the script.  However, there are a few other items to configure to make it a little more viable.
  10. Over under the Contents section, click the package icon right above it to select it (it should say "Untitled Package").  Under the "Configuration" header, you can name the package to something more familiar (e.g. "McAfee Agent 4.0 Patch 2").  Since I only want this installed on the "System Volume", I only check the "System Volume" option and then leave everything else default.
  11. If you want (I did not do this), you can click on the "Requirements" section, and actually add additional requirements before the package can be installed.  This is everything to the OS version (say, 10.6.2 or greater only), to memory, hard drive and CPU minimum specs.  That is totally up to you, but interesting to mess around with.
  12. Now, you can even edit the interface (click the blue "Edit Interface" button on the top right of PackageMaker) to put in a company logo on the package background (or a McAfee logo with their legal's permission of course), as well as change the text to explain what the package is doing.  After you are done, simply close the interface dialog (there is no "save" button, but trust me, it is saved)
  13. You can now simply build the package.  Also, make sure you save your settings you just set up to.  This comes in handy when you need to go back and change it for a newer version of the agent.
1 Reply

Re: include agent in deploystudio workflow? create custom pkg?

The is a shell script. If you don’t need a package for other reasons, you don’t have to make one. If your ultimate and only goal is to include it in DeployStudio workflow only, have you considered adding the script to DeployStudio as a Script, and running it that way? It would likely make sense to set it to “Postponed,” so that it runs after the first reboot of the system from its own internal startup disk.

Not sure if the “-i” flag is required. If so, deployment could be a combination of a “File copy” task (to put “” at a known location on the target disk) and a “Generic” (Script) task that runs the script (with the flag) that was copied. The “Generic” task would be the step to postpone.