【问题标题】:WIX Installer for camera Driver with 2 inf files带有 2 个 inf 文件的相机驱动程序的 WIX 安装程序
【发布时间】:2021-10-25 14:38:07
【问题描述】:

我正在尝试为包含两个 inf 文件的相机驱动程序创建安装程序。到目前为止,我所拥有的是一个工作安装程序,其相关部分如下所示:

        <ComponentGroup Id="MyCamDriver1" Directory="MyCamModuleDir" Source="modules\system\camera\myCam\USBX64">
        <Component Guid="7A259B3A-E41F-460F-8311-03CD89D9A7C5" Win64="$(var.Win64)">
            <File Name="myCamusbX64.inf" KeyPath="yes" />
            <File Name="myCamusbX64.sys" />
            <File Name="myCamusbX64.cat" />
            <File Name="wdfcoinstaller01011.dll" />
            <difx:Driver DeleteFiles="yes" Legacy="yes" AddRemovePrograms="no" PlugAndPlayPrompt="no" />
        </Component>
    </ComponentGroup>
    <!-- <ComponentGroup Id="MyCamDriver2" Directory="MyCamModuleDir" Source="modules\system\camera\myCam\CabUSBX64">  -->
    <!--     <Component Guid="91E30F1E-1C53-49FB-B31E-273CD43120BD" Win64="$(var.Win64)">                              -->
    <!--         <File Name="myCamcabusbX64.inf" KeyPath="yes" />                                                      -->
    <!--         <File Name="myCamcabusbX64.sys" />                                                                    -->
    <!--         <File Name="myCamcabusbX64.cat" />                                                                    -->
    <!--         <File Name="wdfcoinstaller01011.dll" />                                                               -->
    <!--         <difx:Driver DeleteFiles="yes" Legacy="yes" AddRemovePrograms="no" PlugAndPlayPrompt="no" />          -->
    <!--     </Component>                                                                                              -->
    <!-- </ComponentGroup>                                                                                             -->

执行此操作可正常安装 myCamusbX64 驱动程序,卸载也会删除应有的所有内容。但是一旦我添加了未注释的部分,安装程序就不会被创建并显示错误消息:

错误 CNDL0207 组件元素包含意外的子元素“difx:Driver”。 'difx:Driver' 元素只能在 Component 元素下出现 1 次。

实际上,'difx:Driver' 元素是否在组件下只出现一次,不是吗?它甚至在两个不同的组件组中。有人知道如何解决这个问题吗?

【问题讨论】:

    标签: installation components wix driver


    【解决方案1】:

    将显式Ids 添加到每个Component

    【讨论】:

      【解决方案2】:

      Bob Arnson's answer 为我指明了正确的方向。但是,我不得不添加更多更改。这是我现在的工作:

          <ComponentGroup Id="MyCamDriverUSB" Directory="MyCamModuleDirUSB" Source="modules\system\camera\myCam\USBX64">
              <Component Id="MyCamUsbX64" Guid="7A259B3A-E41F-460F-8311-03CD89D9A7C5" Win64="$(var.Win64)">
                  <File Name="myCamusbX64.inf" KeyPath="yes" />
                  <File Name="myCamusbX64.sys" />
                  <File Name="myCamusbX64.cat" />
                  <File Id="WdfUSB" Name="wdfcoinstaller01011.dll" />
                  <difx:Driver DeleteFiles="yes" Legacy="yes" AddRemovePrograms="no" PlugAndPlayPrompt="no" />
              </Component>
          </ComponentGroup>
          <ComponentGroup Id="MyCamDriverCABUSB" Directory="MyCamModuleDirCABUSB" Source="modules\system\camera\myCam\CabUSBX64">
              <Component Id="MyCamCabUsbX64" Guid="91E30F1E-1C53-49FB-B31E-273CD43120BD" Win64="$(var.Win64)">                            
                  <File Name="myCamcabusbX64.inf" KeyPath="yes" />
                  <File Name="myCamcabusbX64.sys" />
                  <File Name="myCamcabusbX64.cat" />                                                                  
                  <File Id="WdfCABUSB" Name="wdfcoinstaller01011.dll" />                                                           
                  <difx:Driver DeleteFiles="yes" Legacy="yes" AddRemovePrograms="no" PlugAndPlayPrompt="no" />        
              </Component>                                                                                            
          </ComponentGroup> 
      

      因此,除了 Bob 向每个组件添加 Id 的建议之外,我还必须向 wdfcoinstaller01011.dll 元素添加一个 Id,并将 ComponentGroups 的 Directory 元素更改为唯一的元素。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2014-04-25
        • 1970-01-01
        • 2020-07-21
        • 1970-01-01
        • 2023-03-16
        • 2017-09-06
        • 2010-12-01
        相关资源
        最近更新 更多