MunkiでMacアプリを展開する
すでにMunkiでMacを管理している場合は、この手順を使用してください。ezeep Admin PortalのApps & Downloadsから、ezeep Print Appの.pkgをダウンロードしてください。
目次
[Step] 1. Import the Print App package with munkiimport and rebuild catalogs
ダウンロードしたパッケージのパスを指定してmunkiimportを実行します。例:
munkiimport "/path/to/ezeep Print App.pkg"
- 項目名と表示名をezeep Print App、カテゴリをPrinting、開発者をThinPrint GmbHに設定します。
- インポートするパッケージのバージョンを使用し、テスト端末で利用するカタログを選択します。
- インポートを確定し、アイコン作成を求められたら作成します。
- プロンプトが表示されたらカタログを再構築します。
インポートで複数のアイコンが生成された場合は、適切なアイコンを残し、リポジトリのiconsフォルダー内でファイル名をezeep Print App.pngに変更します。その後、以下を実行します:
makecatalogs
[/Step]
[Step] 2. Add the catalog and app to the target manifest
manifestutilを開き、カタログとパッケージを対象のマニフェストに追加します。以下の例ではtestingおよびsite_defaultを使用しています。実際の環境名に置き換えてください:
manifestutil
add-catalog testing --manifest site_default
add-pkg ezeep\ Print\ App --manifest site_default
exit
テスト用のMacでManaged Software Centerを開き、利用可能なezeep Print App項目をインストールします。
[/Step]
[Step] 3. テスト用のMacでezeep Print Appを開き、サインインして印刷する
ユーザーにezeep Print Appを開いてサインインしてもらいます。Macでezeepを設定して印刷するに従い、割り当てられたプリンターを確認してテスト印刷を行ってください。
[/Step]
[Step] 4. 次回のユーザーサインイン時にezeepを起動するインストール後スクリプトを追加する
次回のユーザーサインイン時にアプリを自動起動して展開する場合は、以下の内容をmunki_postinstall_script.txtとして保存してください。これにより、ユーザーIDが500–599の範囲にある既存のローカルユーザー向けにヘルパーおよび起動エージェントが作成されます。
#!/bin/sh
if [ ! -d "/Library/PrivilegedHelperTools" ]; then
mkdir "/Library/PrivilegedHelperTools"
chmod 755 "/Library/PrivilegedHelperTools"
fi
helper="/Library/PrivilegedHelperTools/com.thinprint.ezeep.ezeep-Print-App-launchOncePerUser-helper"
if [ -f "$helper" ]; then
rm "$helper"
fi
cat << EOF > "$helper"
#!/bin/sh
open "/Applications/ezeep Print App.app"
rm ~/Library/LaunchAgents/com.thinprint.ezeep.ezeep-Print-App-launchOnce.plist
EOF
chmod 755 "$helper"
out=$(dscacheutil -q user | grep -A 3 -B 2 -e uid:\ 5'[0-9][0-9]' | grep "dir:" | sed -e 's/dir: //g')
for i in $out; do
j=$(basename "$i")
if [ ! -d "$i/Library/LaunchAgents" ]; then
mkdir "$i/Library/LaunchAgents"
chown "$j" "$i/Library/LaunchAgents"
chmod 755 "$i/Library/LaunchAgents"
fi
cat << EOF > "$i/Library/LaunchAgents/com.thinprint.ezeep.ezeep-Print-App-launchOnce.plist"
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key><false/>
<key>Label</key><string>com.thinprint.ezeep.ezeep-Print-App-launchOncePerUser</string>
<key>LimitLoadToSessionType</key>
<array><string>Aqua</string><string>StandardIO</string></array>
<key>ProgramArguments</key>
<array><string>/bin/bash</string><string>$helper</string></array>
<key>RunAtLoad</key><true/>
</dict>
</plist>
EOF
chown "$j" "$i/Library/LaunchAgents/com.thinprint.ezeep.ezeep-Print-App-launchOnce.plist"
chmod 644 "$i/Library/LaunchAgents/com.thinprint.ezeep.ezeep-Print-App-launchOnce.plist"
done
exit 0
スクリプトをパッケージのメタデータで使用できる形式に変換します。
/usr/local/munki/makepkginfo --postinstall_script "/path/to/munki_postinstall_script.txt"
生成されたスクリプト文字列を、パッケージの pkgsinfo の postinstall_script キーに追加します。パッケージの既存のレシートおよびバージョン情報はそのまま保持してください。unattended_install を true、unattended_uninstall を false、uninstall_method を removepackages、uninstallable を true、および RestartAction を RequireRestart に設定します。
pkgsinfo を更新した後、カタログを再構築します。
/usr/local/munki/makecatalogs
すべてのユーザーに展開する前に、管理対象の Mac でサインインと印刷の一連の操作をテストしてください。
[/Step]