Setting Wix icon when advertise is set to no

2019-07-12 01:39发布

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="&quot;%1&quot;"/>
                </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条回答
ら.Afraid
2楼-- · 2019-07-12 02:30

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="&quot;%1&quot;"/>
            </Extension>
        </ProgId>
查看更多
登录 后发表回答