I am creating a dmg file and getting following error while using the icns and png files..
Here is the command:
DeRez -only icns resources/test.icns > icns.rsrc
Error:
/Applications/Xcode.app/Contents/Developer/usr/bin/DeRez - SysError -39 during open of resource file "resources/test.icns"
Mac OS version: macOS mojave 10.14.2
Please suggest.
Encountered this just now as well and noticed this question has gone unanswered, even though it's fairly simple.
Apparently error -39 means
end of file
, I'm assuming this means it wasn't able to find a valid portion of expected data. I'm guessing you (like myself) usedsips -i someicon.icns
to set the file's icon to itself? You should've gotten an error--addIcon is no longer supported
which to me means that it didn't actually set the icon. So a subsequentDeRez
call to get a.rsrc
out of it will fail.I didn't want to install any extra stuff but luckily I found another answer on here that seems to use only standard Xcode and/or macOS tools. In my case I was trying to set an AppleScript-exported
.app
icon, but the actual conversion part should be the same regardless.So, all the steps to go from
.png
to an actual icon for an.app
file:I haven't tried setting custom icons for a
.dmg
file, but I guess you already know how to "apply" the.rsrc
to it anyways. =]