2017-02-20 52 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