2010-06-03 84 views

回答

3
+0

我不知道这是否仍然适用于雪豹。没有为我工作。 – Unicorn 2010-06-03 09:30:54

+2

独角兽:是的。它在10.6.3中一直很好。确保你放置pkg的地方和pkg本身是可写的。 – 2010-06-03 09:38:29

+0

噢,它为我工作。在不正确的地方做。 感谢一吨的信息。 但现在的问题是,当我再次创建包时,这个图标将被改变。是否有可能将这个图标文件添加到pmdoc本身,所以当创建包时,它会自定义图标? – Unicorn 2010-06-03 10:03:18

3
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.