3
我已经使用软件包生成器3.0.4创建了软件包(.pkg)文件。是否可以向.pkg文件提供自定义图标?有人能帮助我如何做到这一点吗? 在此先感谢。更改软件包制造商创建的软件包的图标
我已经使用软件包生成器3.0.4创建了软件包(.pkg)文件。是否可以向.pkg文件提供自定义图标?有人能帮助我如何做到这一点吗? 在此先感谢。更改软件包制造商创建的软件包的图标
Setting an icon for an mpkg, works fine
# create a file that actually going to set the icon file
touch <package_name>.mpkg/Icon$'\r'
# --- copy the customIcon.icns file to the <package_name>.mpkg before doing the sips, if its needed you
# can take a copy of the file before doing the sips command, doing on a copied file will do good
sips -i <package_name>.mpkg/customIcon.icns
DeRez -only icns <package_name>.mpkg/customIcon.icns > tmpIcon.rsrc
Rez -append tmpIcon.rsrc -o $'<package_name>.mpkg/Icon\r'
SetFile -a C <package_name>.mpkg
# removing the tmp file
rm tmpIcon.rsrc
# remove the .icns from mpkg
rm <package_name>.mpkg/customIcon.icns
# if you want you can hide the Icon$'\r' file inside the .mpkg file, file that presently sets the icon
SetFile -a V <package_name>.mpkg/Icon$'\r'
Hope this helps.
我不知道这是否仍然适用于雪豹。没有为我工作。 – Unicorn 2010-06-03 09:30:54
独角兽:是的。它在10.6.3中一直很好。确保你放置pkg的地方和pkg本身是可写的。 – 2010-06-03 09:38:29
噢,它为我工作。在不正确的地方做。 感谢一吨的信息。 但现在的问题是,当我再次创建包时,这个图标将被改变。是否有可能将这个图标文件添加到pmdoc本身,所以当创建包时,它会自定义图标? – Unicorn 2010-06-03 10:03:18