Is Changing the Icon Impossible?

MacGeek
New Contributor III

I want to change my Macintosh HD icon to something different. I used Composer to Monitor File System Changes, copied an icon on my desktop, selected the Macintosh HD and did a Get Info and pasted the new icon over the original one. I entered the Admin name and password, closed the window and voila the icon had changed and I stoped recording.

I exported the Source as a .pkg and I attached it to a policy and ran a test and it failed. Then I rushed to test it on another Mac and it failed. I went through the same process of changing the icon on the other Mac and then tried my .pkg file again and it succeeded. I have since verified this on several other Macs. Once the HD icon has been modified the first time my .pkg works.

Does anyone have a theory on why this happens and how to fix it or a better method to change the icon? Thanks!

4 REPLIES 4

mm2270
Legendary Contributor III

There are 3rd party utilities that can be used in a script to change the icon of folders and files, but they don't, to my knowledge work on the Macintosh HD icon on the Desktop. The hard drive is not your typical file or folder, so it doesn't always play by the same rules as those other containers.
One thing I do know is that when you paste a custom icon onto a volume, like Macintosh HD, it creates an invisible ".VolumeIcon.icns" file at the root of the drive. If the icon gets removed or has never been applied, that .VolumeIcon.icns file isn't present. You can see this by doing ls -al / before and after applying your custom icon. I suspect your pkg may not be properly applying the .VolumeIcon.icns file to the HD when the pkg is run, but if one is already present, it's able to change it something else.

In short, I don't know of a good way to change the hard drive icon.

But this all leads me to ask why this is really necessary? Is it that important to change the Macintosh HD icon? Just wondering how much the effort is worth it in this case.

MacGeek
New Contributor III

The package I created does install a .VolumeIcon.icns at the root level. Something gets switched on or off that allows this change to happen and I'm hoping someone has the answer.

6ac98dac529045e6844cbc845a775a9c
Why does Apple change the icons and why do they give us a method to do it? I've been making an original OS hard drive icon which ties into our legal login screen for over two decades for several reasons. 1) My users are graphic artists who look forward to seeing each new OS icon. 2) It makes it much easier identifying the hard drive on a messy desktop 3) For support a user can identify what OS they are running from halfway across the room. 4) I'm trying to duplicate what I use to be able to do easily when making a traditional image. I was told I could and after spending a lot of money and time I'm finding out I can't... another topic.

mm2270
Legendary Contributor III

Have you tried this? I just did a quick test and miraculously this works.

sudo cp /path/to/icon.icns /Volumes/Macintosh HD/.VolumeIcon.icns

Basically a simple copy command of the custom icon in .icns form (likely must be an icns to work) to the root volume as .VolumeIcon.icns

This actually worked on my 10.12.6 machine. The Finder immediately recognized the change and the HD icon was updated!
I haven't tested it on HS, but it might still work there too.

If that works, you can probably create a pkg that drops your custom icon into /tmp/ and then runs a postinstall script with something like the above without the sudo since it shouldn't be needed.

MacGeek
New Contributor III

I'm using 10.13.6 and it didn't work. I can see that the command did replace the .VolumeIcon.icns files with my new icon image but the hard drive image icon didn't change. It also didn't change after I rebooted or running my installer made from Composer after I ran your script. Thanks for trying and have a great weekend!