Search code examples
wpfvisual-studioinstallshield

InstallShield: cannot extract icon with index 0


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?


Solution

  • 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.