Setting Wix icon when advertise is set to no

别等时光非礼了梦想. 提交于 2019-12-23 23:09: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:


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>


来源:https://stackoverflow.com/questions/31403264/setting-wix-icon-when-advertise-is-set-to-no

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!