Install PKG from a directory

AbeZ_Tt
New Contributor II

...a complete newbie here, please be easy on me

I plan to cache a PLIST and a PKG using a policy and use a script to trigger the installation (they have to be in the same directory when installing per the vendor). I am struggling with such a script which I figured would find somewhere in this forum but I could not. Can anyone help?

I tried to execute the following command from the File and Processes section, 

installer -pkg /Applications/Open Client/installer_10.22.pkg -target /

but I get this error

Result of command:
installer: invalid option Roaming Usage: installer [-help] [-dominfo] [-volinfo] [-pkginfo] [-allowUntrusted] [-dumplog] [-verbose | -verboseR] [-vers] [-config] [-plist] [-file <pathToFile>] [-lang <ISOLanguageCode>] [-listiso] [-showChoicesXML] [-applyChoiceChangesXML <pathToFile>] [-showChoicesAfterApplyingChangesXML <pathtoFile>]

-pkg <pathToPackage>

-target <[DomainKey|MountPoint]>

 

any help appreciated please, thanks

1 ACCEPTED SOLUTION

sdagley
Honored Contributor III

@AbeZ_Tt It looks like your path used “smart quotes”rather than basic quotes "" - always use basic quotes.

View solution in original post

4 REPLIES 4

Hugonaut
Valued Contributor II

@AbeZ_Tt 

 

you need to add parenthesis, there is a space in the open client directory. replace your command with what I paste below.

 

installer -pkg "/Applications/Open Client/installer_10.22.pkg" -target /

________________
Looking for a Jamf Managed Service Provider? Look no further than Rocketman
________________


Virtual MacAdmins Monthly Meetup - First Friday, Every Month

sdagley
Honored Contributor III

@AbeZ_Tt You either have to escape or quite a path for a command in the Files & Processes payload, so for your example it would be:

installer -pkg "/Applications/Open Client/installer_10.22.pkg" -target /

That path isn't where a Jamf Pro policy will cache a .pkg though...

I would recommend you use Composer to create a wrapper .pkg for the vendor .pkg and your .plist to put them in the same temporary directory (e.g. in /private/tmp/OpenClientInstall) and use a post install script to run the installer command on the vendor's .pkg

AbeZ_Tt
New Contributor II

Thank you

I did just that and get the following error

installer: Error - the package path specified was invalid: '“/private/tmp/Open_installer/Open.pkg”'.

the pkg and plist are in the /private/tmp/Open_installer location, works when I try installing it manually.

Any clues on what I may be doing wrong?

sdagley
Honored Contributor III

@AbeZ_Tt It looks like your path used “smart quotes”rather than basic quotes "" - always use basic quotes.