InstallShield: cannot extract icon with index 0
Asked Answered
V

4

12

I can't seem to figure out why this error is occurring when I build my setup.exe installation file.

Error 5 -3204: Cannot extract icon with index 0 from file C:\dev\MyProj4\MyProjClientWpf\obj\x86\Release\MyProjClient.exe. ISEXP : error : -3204: Cannot extract icon with index 0 from file C:\dev\MyProj4\MyProjClientWpf\obj\x86\Release\MyProjClient.exe.

In the Shortcuts/Folders section, for the shortcut I'm generating, Icon File is blank, and Icon Index is 0. Whatever default icon is fine, I didn't specify one nor do I even want one.

Any ideas?

Vat answered 13/4, 2011 at 16:18 Comment(0)
W
8

Windows Installer Advertised Shortcuts require an icon resource. At build time, InstallShield will extract this resource and populate the Icon table. This error is saying that this wasn't possible.

The simplest solution is to add an icon resource to your project and rebuild the EXE:

  • Right click your WPF project in Solution Explorer and select Properties in the menu;
  • In the Properties page, select the Application tab (it should be already selected);
  • Go to the Resources section and click on the (...) at the right of the Icon field;
  • Select your desired .ico file and click Open.

Alternatively you can set the shortcut to not be Advertised and Windows will resolve a default icon for you when the start menu is displayed. You will lose some of the advertisement capabilities of MSI in doing this so I really suggest that you just provide it with an Icon.

Walking answered 14/4, 2011 at 10:44 Comment(1)
Note that a new WPF project does not include an icon, which is why your recommendation to add an icon to the WPF project is spot on. Arguably InstallShield should "extract" the default .exe icon in this scenario, but does anybody really want that for their advertised shortcut?Baronage
M
25

I was getting this problem, I try a lot of solutions on the web, but the only way that works for me:

  1. Expand the setup project (Solution Explorer)
  2. Expand the menu "Configure the Target System"
  3. Double click on Shortcuts folder
  4. Here you will find 2 output you set up in the project wizard.
  5. Select one of them, and find the property Icon, click to (...) to browse the propertly icon.
  6. Do the same with the second one output built solution.
  7. Rebuild your project!

Regards,

Memnon answered 10/1, 2014 at 15:51 Comment(4)
The problem I have with this approach is that if someone manually creates a shortcut the icon won't be the same. It's best to just build the EXE with the desired default icon and take the default behavior of build time icon extraction.Walking
One of the great problem is assuming the reader in inside of the mind of the writer. I don't have a clue of what you're talking about. After looking around the Solution explorer I was able to find the "Configure the Target System" so the first step in this answer is useless. There is no + in Visual Studio, also deploy solution is my main project or my InstallShield project?Whity
"Here you will find 2 output you set up in the project wizard." What are those outputs? I only see folders to set shortcuts, not output projects.Whity
"click to (...) to browse the propertly icon" and then what? Do I need to set an icon? Do I need to remove the icon? Do I need to look at the icon?Whity
W
8

Windows Installer Advertised Shortcuts require an icon resource. At build time, InstallShield will extract this resource and populate the Icon table. This error is saying that this wasn't possible.

The simplest solution is to add an icon resource to your project and rebuild the EXE:

  • Right click your WPF project in Solution Explorer and select Properties in the menu;
  • In the Properties page, select the Application tab (it should be already selected);
  • Go to the Resources section and click on the (...) at the right of the Icon field;
  • Select your desired .ico file and click Open.

Alternatively you can set the shortcut to not be Advertised and Windows will resolve a default icon for you when the start menu is displayed. You will lose some of the advertisement capabilities of MSI in doing this so I really suggest that you just provide it with an Icon.

Walking answered 14/4, 2011 at 10:44 Comment(1)
Note that a new WPF project does not include an icon, which is why your recommendation to add an icon to the WPF project is spot on. Arguably InstallShield should "extract" the default .exe icon in this scenario, but does anybody really want that for their advertised shortcut?Baronage
M
2

This issue occurs if create shortcut is enabled and icon is not set. 1. Goto Project assistant -> Application shortcuts. 2. Download some icon, browse and select it for Use alternate shortcut icon.

Rebuild.

Marginate answered 31/3, 2015 at 17:53 Comment(0)
G
0

Simple Solution:

At the time of Installation Wizard, while missing the reselection of the Image / Icon for shortcut after we have browsed the resource path. Missing this causes this index error (please refer screenshot). after re-selection rebuild is required this solves problem.

enter image description here

Gebelein answered 15/7, 2016 at 11:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.