# Vista Icon Problem

**URL:** https://www.finalbuilder.com/forums/t/vista-icon-problem/559
**Category:** Discussion
**Created:** [August 13, 2007, 1:06am UTC](https://www.finalbuilder.com/forums/t/vista-icon-problem/559 "2007-08-13T01:06:33Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![wasowerby](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/w/b77776/32.png) [@wasowerby](https://www.finalbuilder.com/forums/u/wasowerby)
#### Post date: [August 13, 2007, 1:06am UTC](https://www.finalbuilder.com/forums/t/vista-icon-problem/559/1 "2007-08-13T01:06:33Z")

</div>

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

&nbsp;

---

<div class="post-metadata">

### Author: ![wasowerby](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/w/b77776/32.png) [@wasowerby](https://www.finalbuilder.com/forums/u/wasowerby)
#### Post date: [August 16, 2007, 10:41am UTC](https://www.finalbuilder.com/forums/t/vista-icon-problem/559/2 "2007-08-16T10:41:40Z")

</div>

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](http://www.skylogservices.co.uk)\PRO\V6\SkyLog\_Vista.zip   
  
 Thanks…Andrew

---

<div class="post-metadata">

### Author: ![wasowerby](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/w/b77776/32.png) [@wasowerby](https://www.finalbuilder.com/forums/u/wasowerby)
#### Post date: [August 16, 2007, 10:43am UTC](https://www.finalbuilder.com/forums/t/vista-icon-problem/559/3 "2007-08-16T10:43:33Z")

</div>

Zipped icon file now attached.

Regards...Andrew

[SkyLog\_Vista.zip](https://www.finalbuilder.com/forums/uploads/default/original/2X/d/db88196c4cffeebfbe031c042c0e44ec74788740.zip) (32.962 KB)

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [August 17, 2007, 2:58am UTC](https://www.finalbuilder.com/forums/t/vista-icon-problem/559/4 "2007-08-17T02:58:26Z")

</div>

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

---

<div class="post-metadata">

### Author: ![wasowerby](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/w/b77776/32.png) [@wasowerby](https://www.finalbuilder.com/forums/u/wasowerby)
#### Post date: [August 17, 2007, 10:14am UTC](https://www.finalbuilder.com/forums/t/vista-icon-problem/559/5 "2007-08-17T10:14:29Z")

</div>

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

---

<div class="post-metadata">

### Author: ![wasowerby](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/w/b77776/32.png) [@wasowerby](https://www.finalbuilder.com/forums/u/wasowerby)
#### Post date: [August 17, 2007, 1:03am UTC](https://www.finalbuilder.com/forums/t/vista-icon-problem/559/6 "2007-08-17T01:03:57Z")

</div>

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

---

<div class="post-metadata">

### Author: ![wasowerby](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/w/b77776/32.png) [@wasowerby](https://www.finalbuilder.com/forums/u/wasowerby)
#### Post date: [August 17, 2007, 3:08am UTC](https://www.finalbuilder.com/forums/t/vista-icon-problem/559/7 "2007-08-17T03:08:32Z")

</div>

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

---

<div class="post-metadata">

### Author: ![wasowerby](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/w/b77776/32.png) [@wasowerby](https://www.finalbuilder.com/forums/u/wasowerby)
#### Post date: [August 18, 2007, 6:14am UTC](https://www.finalbuilder.com/forums/t/vista-icon-problem/559/8 "2007-08-18T06:14:23Z")

</div>

And, for info:   
  
 ReplaceVistaIcon.exe %FOLDERPATH%\myexe.exe %FOLDERPATH%\myicon.ico MAINICON   
  
 does it.   
  
 Regards…Andrew

---

<div class="post-metadata">

### Author: ![angus](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/a/b3f665/32.png) [@angus](https://www.finalbuilder.com/forums/u/angus)
#### Post date: [August 20, 2007, 1:50am UTC](https://www.finalbuilder.com/forums/t/vista-icon-problem/559/9 "2007-08-20T01:50:32Z")

</div>

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

---

<div class="post-metadata">

### Author: ![wasowerby](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/w/b77776/32.png) [@wasowerby](https://www.finalbuilder.com/forums/u/wasowerby)
#### Post date: [August 20, 2007, 10:43am UTC](https://www.finalbuilder.com/forums/t/vista-icon-problem/559/10 "2007-08-20T10:43:20Z")

</div>

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
