Apple installer utility help for bash script

I am trying to use the Apple Installer commands to install a package and the conclusion is that it was successful, however the end result is that nothing happens as the package is never installed or run. Can someone please review the commands and tell me what is wrong, or try to see for yourself what might be the problem?

#Machines must have cURL installed as a prerequisite to download software from internet or FTP server 

#grab files from www.teamviewer.com or custom FTP server
curl -O http://download.teamviewer.com/download/TeamViewerHost.dmg

#Mount and Install TeamViewer
hdiutil mount /Users/TeamViewer/Downloads/TeamViewerHost.dmg
sudo cp -R "/Volumes/TeamViewerHost" /Applications

#Run installer
sudo installer -package /Applications/TeamViewerHost/Install\ TeamViewerHost.pkg -target "/Volumes/TeamViewerHost"

#Unmount package
cd ~
hdiutil unmount "/Volumes/TeamViewerHost/"

      

Or what else I tried - this with the same result:

#Machines must have cURL installed as a prerequisite to download software from internet or FTP server 

#grab files from www.teamviewer.com or custom FTP server
curl -O http://download.teamviewer.com/download/TeamViewerHost.dmg

#Mount and Install TeamViewer
hdiutil mount /Users/TeamViewer/Downloads/TeamViewerHost.dmg

#Run installer
sudo installer -package /Volumes/TeamViewerHost/Install\ TeamViewerHost.pkg -target "/Volumes/TeamViewerHost"

#Unmount package
cd ~
hdiutil unmount "/Volumes/TeamViewerHost/"

      

Need to install TeamViewer via SSH via terminal, but Installer doesn't play well. Any help would be greatly appreciated. thanks in advance

+3


source to share


1 answer


Run:

sudo installer -pkg /Volumes/TeamViewerHost/Install\ TeamViewerHost.pkg -target /

      

-target /

means - where "root" is for the installation package.

When you said -target "/Volumes/TeamViewerHost"

it tries to install .dmg

read-only into mounted , not what you want.

Ps: better ask at apple.stackexchange.

EDIT:



Just tried the following:

ssh me@myanothercomp.local
cd Downloads
curl -O http://downloadeu1.teamviewer.com/download/TeamViewerHost.dmg
hdutil mount TeamViewerHost.dmg
sudo installer -pkg /Volumes/TeamViewerHost/Install\ TeamViewerHost.pkg -target /

      

sudo / installer prints:

Password:
installer: Package name is TeamViewerHost
installer: Installing at base path /
installer: The install was successful.

      

and installed TeamViewerHost.app

in /Applications

on a remote Mac.

+3


source







All Articles