Changing icon of package created by package maker

[亡魂溺海] 提交于 2019-12-07 15:53:52

问题


I have created package (.pkg) file using packagemaker ver 3.0.4. Is it possible to provide custom icon to the .pkg file. Can some one help me how this can be done ? Thanks in advance.


回答1:


The same way you set any other file's, folder's, or package's custom icon.




回答2:


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.


来源:https://stackoverflow.com/questions/2963855/changing-icon-of-package-created-by-package-maker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!