3

PackageMakerを使用してパッケージを作成しましたが、.pkgファイルのデフォルトアイコンを変更したいと思います。グーグルした後、ここhttp://sveinbjorn.org/osxutils_docsのseticonユーティリティは、最新のLion 10.7(カーネル11.0.0)を除くすべてのOSX-esの問題を解決しました。デフォルトのアイコンは、ダブルクリックに対して鈍感な灰色の四角に置き換えられました。ファイルの関連付けが壊れているように見えます。

さらに2日間グーグルすると、リソースフォーク、SetFile(1)、およびこの古いスレッドのような他の便利なスタッフについての知識が得られました。パッケージメーカーによって作成されたパッケージのアイコンを変更しましたが、まだ運がありません。

私は次のようなことをしようとしています:

target = pack.pkg

icon_filename = "$(perl-e'print"アイコン\r"')"

「$target/ .. namedfork / rsrc /$icon_filename」をタッチします

cp "Icon.icns" "$ target / .. namedfork / rsrc / $ icon_filename"

/ Developer / Tools / SetFile -a C "$ target"

そして取得:build-Mac:pack.pkg / ..namedfork/ディレクトリではありません。

私は何が間違っているのですか?Lionのリソースフォークの違いを教えてもらえますか?他のスクリプト可能なソリューションはありますか?

私はMACの完全な初心者であり、ダミーの詳細な回答をいただければ幸いです。

4

1 に答える 1

2

誰かがそれを必要とする場合に備えて、ここに置いて、私はついにそれを理解しました。私はアップルスクリプトを使用しました:

set newIcon to (POSIX file "IconMac.icns") as alias
set theItem to (POSIX file "Installer.pkg") as alias

tell application "Preview"
activate
open newIcon
end tell
tell application "System Events"
tell process "Preview"
    keystroke "c" using command down
end tell
end tell
tell application "Preview" to quit

tell application "Finder"
set infoWindow to open information window of theItem
set infoWindowName to name of infoWindow
end tell

tell application "System Events"
tell application process "Finder"
    tell window infoWindowName
        keystroke tab
        delay 1
        keystroke "v" using command down
    end tell
end tell
end tell

tell application "Finder"
close infoWindow
end tell
于 2012-01-24T09:34:01.583 に答える