wixtoolset / issues

WiX Toolset Issues Tracker
http://wixtoolset.org/
129 stars 36 forks source link

Extract Icon Resources from PE Files #4340

Open wixbot opened 10 years ago

wixbot commented 10 years ago

A recent question on stack overflow centered around MSI bloat as an EXE was being included twice when the developer expected it only once (smartcabbing). The bloat was from the Icon table. It would be nice if the Icon element had an optional IconIndex attribute that if present would cause WiX to extract the icon resource during the build and use that as it's source path instead of the primary source path. FWIW, InstallShield does this as it's icon table is Name, Data, ISBuildSourcePath and ISIconIndex where the last two columns are removed from the final MSI.

Originally opened by chrpai

wixbot commented 10 years ago

Hello I have simple shortcut with icon declared in following way:

<Component Id="my.exe" Guid="MY-GUID">
    <File Id="my.exe" Source="$(var.Project.TargetPath)" KeyPath="yes">
      <Shortcut Id="MyShortcut" Directory="ApplicationMenuFolder" Name="My App" WorkingDirectory="ApplicationRootFolder" Icon="my.exe" IconIndex="0"  Advertise="yes">
        <Icon Id="my.exe"  SourceFile="$(var.Project.TargetPath)" />
      </Shortcut>
    </File>
 </Component>

What I'm expecting is adding exe once to msi, but it is added twice, because of Icon Table.

Originally posted by msmolka

wixbot commented 10 years ago

Area set to compiler Release set to v3.x

chrpai commented 9 months ago

@robmen @barnson any chance we can do this in v5? I'd suggest an optional attribute like IconIndex that tells wix to extract that resource and place it in the table instead of the actual file. This would be very helpful for IsWiX as I could author a browse/preview in the designer and then author the XML accordingly.

barnson commented 9 months ago

No, I'm full up for WiX v5.

chrpai commented 9 months ago

I'm you actively against such a feature? Assign it to me and I could give it a try. This is a high value feature to me so I'd be willing to fund it if someone wante to give me a price.

barnson commented 9 months ago

No, but there's overlap with the ARP feature that would need to be address in the WIP.

chrpai commented 9 months ago

What/where is the ARP feature? Is that basically the same type of situation but instead of referenced by a shortcut its referenced by ARPPRODUCTICON? If so I can imagine a couple possible paths:

1) Introduce a new attribute (resource id) and if found extract the resource and stream that into the Icon table.

2) Auto detect the file type and automatically extract icon 0 and stream that in or stream the file as is.

3) Other?

barnson commented 9 months ago

Strongly-typed authoring for product registration.