首页 > 解决方案 > 错误 ICE18:组件的 KeyPath:“DeviceStartup”是目录:

问题描述

构建 WIX 项目时出现以下错误。

ICE18:组件的 KeyPath:“DeviceStartup”是目录:“INSTALLDIR”。目录/组件对必须列在 CreateFolders 表中。PCE1.0.1 E:\Data\PCE1\PCE1.0.1 E:\Data\PCE1\PCE1.0.1\PCE_WiX_Installer_EN.wxs 48 1 构建

下面是代码片段:

<Directory Id="INSTALLDIR" ShortName="PCE" Name="PowerChart Application">
<Component Id="DeviceStartup" Guid="{52B316C2-77EA-11E0-B16E-49D64824019B}">
   <Shortcut Id="startupEXE" Directory="StartupFolder" Name="Device Status" ShortName="DeviceStat" Target="[INSTALLDIR]Display.exe" />
 </Component>

错误显示在“组件”元素的位置。

为此,作为解决方法的一部分,我为“组件”元素添加了 KeyPath="yes"。这样我就解决了这个问题。

我可以采用这种解决方法吗?请建议?

标签: wixwix3.5wix3

解决方案


Could you just put the shortcut in the same component as the executable? There is a sample below. Do you install per-user or per-machine?

<Directory Id="TARGETDIR" Name="SourceDir">

  <Directory Id="StartupFolder" />

  <Component Id="Product.exe" Feature="Main">
     <File Source="Product.exe" KeyPath="yes">
        <Shortcut Id="startupEXE" Directory="StartupFolder" Name="Product" Advertise="yes" />
     </File>
  </Component>

</Directory>

推荐阅读