bash 脚本的 Apple 安装程序命令帮助
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/25409584/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Apple installer command help for bash script
提问by gogo
I am trying to use the Apple Installer commands to install a package and the output is that it was successful, however, the end result is that nothing actually happens meaning the package never gets installed or launched. Could someone please look over the commands and tell me what is wrong or try it themselves to see what could be the issue?
我正在尝试使用 Apple Installer 命令来安装一个包,输出是它成功了,但是,最终结果是实际上什么也没发生,这意味着该包永远不会被安装或启动。有人可以查看命令并告诉我有什么问题或自己尝试看看可能是什么问题吗?
#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 have tried is 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/"
The need is to install TeamViewer over SSH through terminal, but Installer is not playing nice. Any help would be greatly appreciated. Thanks in advance
需要通过终端通过 SSH 安装 TeamViewer,但安装程序运行不佳。任何帮助将不胜感激。提前致谢
回答by Nemo
Run:
跑:
sudo installer -pkg /Volumes/TeamViewerHost/Install\ TeamViewerHost.pkg -target /
The -target /
mean - where the the "root" for the installing package.
该-target /
均值-其中“根”的安装包。
When you said -target "/Volumes/TeamViewerHost"
it tries install into the mounted .dmg
what is read-only and not what you want.
当您-target "/Volumes/TeamViewerHost"
说它尝试安装到已安装.dmg
的只读内容而不是您想要的内容时。
Ps: better to ask on apple.stackexchange.
Ps:最好在apple.stackexchange 上询问。
EDIT:
编辑:
Just tried the next:
刚刚尝试了下一个:
ssh [email protected]
cd Downloads
curl -O http://downloadeu1.teamviewer.com/download/TeamViewerHost.dmg
hdutil mount TeamViewerHost.dmg
sudo installer -pkg /Volumes/TeamViewerHost/Install\ TeamViewerHost.pkg -target /
the sudo/installer prints:
sudo/安装程序打印:
Password:
installer: Package name is TeamViewerHost
installer: Installing at base path /
installer: The install was successful.
and got installed the TeamViewerHost.app
into the /Applications
on the remote Mac.
并安装TeamViewerHost.app
到/Applications
远程 Mac 上。