2017-02-20 50 views
1

我已经签名了设备驱动程序。对于Windows 10和Windows 7,签名要求不同,因此我有两套驱动程序文件。为Windows 10和Windows 7安装不同的文件

我想使用一个.wxs文件,并让安装程序根据我安装的Windows版本选择文件集。为了简单起见,我在Win 10上使用VersionNT >= 603,在Win 7上使用VersionNT < 603。我忽略了这样的事实,即现在不考虑Windows或Server版本的早期版本。

我所做的是创建两个Wix <Components>,每个都有唯一的名称和GUID。内<Component>我:

<!-- Pre-Win 10 --> 
<difx:Driver AddRemovePrograms="no" DeleteFiles="yes" ForceInstall="no" Legacy="no" PlugAndPlayPrompt="no" /> 
<Condition><![CDATA[(VersionNT64 < 603)]]></Condition> 
<File .... 

<!-- Win 10 --> 
<difx:Driver AddRemovePrograms="no" DeleteFiles="yes" ForceInstall="no" Legacy="no" PlugAndPlayPrompt="no" /> 
<Condition><![CDATA[(VersionNT64 >= 603)]]></Condition> 
<File .... 

然后我包括<ComponentRef>在功能这两个组件。

这编译,但给出警告,每个.sys.cat和形式的.inf

C:\Users\me\Documents\src\Product\installer\Product.wxs(103,0): warning LGHT1076: ICE30: The target file 'driver.sys' might be installed in '[ProgramFiles64Folder]\Vendor\brbq3-yp\drivers\so-utx6z\' by two different conditionalized components on an SFN system: 'win10_driver' and 'win7_driver'. If the conditions are not mutually exclusive, this will break the component reference counting system. 

在这种情况下,我知道这两个条件是相互排斥的,但我想清理警告。

任何人都可以推荐一个更干净的方式来安装这些互斥的驱动程序文件集,而无需创建两个.msi软件包吗?

回答

6

由于您的创作可容纳警告条件,因此可以禁止ICE30以避免构建中的警告消息。将SuppressIces属性添加到您的.wixproj中,值为ICE30

+0

谢谢。至少可以摆脱警告。我仍然想知道是否没有更好的方法来编写代码。 – Daniel