Mac-Osx
如何在 MacOS 中靜默安裝 .dmg?
我有一個需要在多台電腦上安裝的 .dmg MacOS 包(帶有“繼續”按鈕、EULA 等)。是否像 Windows 中的靜默 MSI 安裝一樣通過 bash/python/ruby/etc 腳本靜默執行此操作?我可以自動化安裝腳本,它會為我點擊按鈕,但這看起來有點不自然:)。
要安裝 DMG,您可以這樣做:
cd ~/Desktop curl -O http://darwinports.opendarwin.org/downloads/DarwinPorts-1.2-10.4.dmg hdiutil attach DarwinPorts-1.2-10.4.dmg cd /Volumes/DarwinPorts-1.2/ sudo installer -pkg DarwinPorts-1.2.pkg -target "/" hdiutil detach /Volumes/DarwinPorts-1.2/
簡而言之,這
- 轉到您的桌面文件夾
- 從 opendarwin 站點獲取 DarwinPorts
- 安裝 dmg
- 轉到新安裝的 DarwinPorts 卷
- 以 root 使用者身份安裝以 root 為目標的軟體包
- 彈出已安裝的光碟映像。
然後,您可以使用Automator來執行此操作…
取自此頁面的程式碼