问题
Seems like I'm forever asking questions about Wix. This should be the last, and it's just a polishing one.
I'm wanting my associated files to have an icon to go with them, but in my ProgId element, the advertise is not specified which I assume defaults to no. Therefore in the wix documentation, it states:
For an advertised ProgId, the Id of an Icon element. For a non-advertised ProgId, this is the Id of a file containing an icon resource.
I'm not understanding how this works at all. Do I set up a folder that contains the icon and reference it with IconIndex? This is the part of the .wxs I'm working with.
<Component Id ="MyApp.exe" Guid="{GUID-HERE}">
<File Id="MyApp.exe" KeyPath="yes" Source="$(var.MyApp.TargetDir)MyApp.exe" />
<ProgId Id ="MyAppProgID" Description="MyApp data files" Icon ="Logo.ico" IconIndex="0">
<Extension Id ="myapp" ContentType="application/myapp">
<Verb Id ="open" Command="open" TargetFile="MyApp.exe" Argument=""%1""/>
</Extension>
</ProgId>
<Icon Id="Logo.ico" SourceFile="$(var.MyApp.TargetDir)\Icon\Logo.ico"/>
I'm struggling to find any examples or proper documentation on a lot of the ProgId functionality for wix.
Thanks in advance
回答1:
You need change Icon element to File and remove IconIndex
<Component Id ="MyApp.exe" Guid="{GUID-HERE}">
<File Id="MyApp.exe" KeyPath="yes" Source="$(var.MyApp.TargetDir)MyApp.exe" />
<File Id="Logo.ico" SourceFile="$(var.MyApp.TargetDir)\Icon\Logo.ico"/>
<ProgId Id ="MyAppProgID" Description="MyApp data files" Icon ="Logo.ico">
<Extension Id ="myapp" ContentType="application/myapp">
<Verb Id ="open" Command="open" TargetFile="MyApp.exe" Argument=""%1""/>
</Extension>
</ProgId>
来源:https://stackoverflow.com/questions/31403264/setting-wix-icon-when-advertise-is-set-to-no