2010-06-03 3 views

Répondre

3
+0

Je ne sais pas si cela est encore applicable pour le léopard des neiges. N'a pas travaillé pour moi. – Unicorn

+2

Licorne: C'est. Cela fonctionne très bien tout au long de 10.6.3. Assurez-vous que l'emplacement où vous placez le pkg et le pkg lui-même sont accessibles en écriture. –

+0

Oh oui, ça a marché pour moi. Était en train de faire à un endroit incorrect. Merci beaucoup pour l'info. Mais maintenant le problème est quand je crée à nouveau le paquet cette icône sera changée. Est-il possible d'ajouter ce fichier icône à pmdoc lui-même alors quand jamais un paquet est créé, il aura une icône personnalisée? – Unicorn

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. 
Questions connexes