Autogen guid (*) in Windowsinstaller cause ICE08 e

2019-07-25 16:26发布

Two component tags in my wxs file is as folllows

<Component Id="Comp.Comp1" Guid="*" >
<Condition><![CDATA[VersionNT < 602]]></Condition>
<File Id="File1" Source="$(Dir1)\TestFile.dll" />
 </Component>

<Component Id="Comp.Comp2" Guid="*" >
<Condition><![CDATA[VersionNT >= 602]]></Condition>
<File Id="File2" Source="$(Dir2)\TestFile.dll" />
 </Component>

But iam getting an error as below

ICE08: Component: Comp.Comp2 has a duplicate GUID: {2963D8E7-CBEC-50C8-AF4B-65E895FE3283}   

How iam getting this error eventhough i gave an autogen guid value "*"

Thanks,

2条回答
爷的心禁止访问
2楼-- · 2019-07-25 17:07

You didn't show the context of this snippet ( Directory Elements) but to me it seems you are installing the same filename to the same directory twice. That's a component rule violation. The "source" is different but the conditions are the same : !VersionNT >= 602.

查看更多
姐就是有狂的资本
3楼-- · 2019-07-25 17:27

The star-GUID for Component elements calculates a stable GUID based on the target location of the file. The stability of the GUID is vital for future updates (particularly patching). It works great in many cases but mutually exclusive Components that put a file into the exact same location is not one. In this case, you'll need to explicitly set at least one of your Component/@Guids.

In the above case, you can do the following:

<Component Id="Comp.Comp1" Guid="*" >
    <Condition><![CDATA[VersionNT < 602]]></Condition>

    <File Id="File1" Source="$(Dir1)\TestFile.dll" />
</Component>

<Component Id="Comp.Comp2" Guid="PUT-GUID-HERE">
    <Condition><![CDATA[VersionNT >= 602]]></Condition>

    <File Id="File2" Source="$(Dir2)\TestFile.dll" />
</Component>

Technically speaking you could suppress the ICE08 error in this case because the Components are mutually exclusive but I, personally, would do the above before suppressing the ICE. IMHO, it is preferable that the different files have different GUIDs ultimately anyway.

查看更多
登录 后发表回答