Vista Icon Problem

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.

Using FB 5.5.0.340. Any ideas?

Regards...Andrew

 

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:

www.skylogservices.co.uk\PRO\V6\SkyLog_Vista.zip

Thanks…Andrew

Zipped icon file now attached.

Regards...Andrew

SkyLog_Vista.zip (32.962 KB)

Hi Andrew,

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

That should get you up and running.


Regards,

Angus

Thanks Angus. Will have alook at the 3rd party tool.

Regards…Andrew

Unfortunately, I can’t get it (ReplaceVistaIcon.exe) to work using:

ReplaceVistaIcon.exe “E:\Skylog Project\Skylog V6\Skylog Pro\Skylgpro.exe” “E:\Skylog32\Images\SkyLog_Vista.ico”

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?

Regards…Andrew

Never mind, the ReplaceVistaIcon.exe was corrupted during downloading; re-downloading (a few hours later!) fixed the problem and all now works ok.

Regards…Andrew

And, for info:

ReplaceVistaIcon.exe %FOLDERPATH%\myexe.exe %FOLDERPATH%\myicon.ico MAINICON

does it.

Regards…Andrew

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!

Regards,

Angus

Yes, you need to add a standard XP icon in the D2007 Compile action and then run ReplaceVistaIcon.exe using:

ReplaceVistaIcon.exe %FOLDERPATH%\myexe.exe %FOLDERPATH%\myvistaicon.ico MAINICON

to replace the 1st icon (MAINICON) with the Vista icon. That seems to work ok.

Regards…Andrew