When I try to add a vista comptatible icon to the 'Compile Delphi Win32 Project->Project->Icon File' action, I get error 'Unable to load icon (probably corrupt): Pixel format not valid for icons or cursors'. When I compile my project in the D2007 IDE with that icon file in the Project->Options->icon', the project compiles ok with that icon. The icon is created for Vista by Axialis Icon Workshop V5.
I would appreciate a reply to this as, at present, I’m unable to use FB to create Vista installs of my apps. I can’t seem to attach the icon file to this message, so you can download it from:
Thanks for your post. Sorry it's taken us a few days to get back to you.
There are actually two problems here:
1) Is that Delphi's image component doesn't support loading Vista-formatted icons from ico files. When we try to display the icon on the property page, you see the error that you described above. However, I've relabelled the error as a Warning because that's all it is - FinalBuilder will keep trying to use that icon file, despite not being able to load the preview onto the property page.
However, there's another problem:
2) Neither Borland's Resource Compiler nor the Visual Studio 2005 Resource Compiler support Vista icons. The Delphi IDE actually uses an internal resource compiler(!) When you try to compile the RC file as part of FinalBuilder, it will fail.
If you have the Visual Studio 2008 beta, it's possible that you can use the included resource compiler to compile the RC file (just change the path to the tool on the Resource Compiler tab.)
If you don't have 2008, then I found a simple third party command-line tool to integrate a Vista-compatible icon to an already built executable. You can find it at this URL: http://www.rw-designer.com/compile-vista-icon
I do the build using an XP compatible icon and then run an ‘Execute Program’ action with the above parameters, but the 1 XP MAINICON isn’t replaced by the 12 Vista icons. Must be doing something wrong?
Thanks for the update Andrew, glad you got it working.
I think the web page also says something about Windows only using the first icon resource it finds, so you may need to remove the other icons before adding the new ones. Hopefully Microsoft and Codegear will both get around to updating their resource compilers in the near future!