2014-03-13 51 views
9

學習如何創建Wix Booloader,以便可以使用我的msi安裝包來安裝.NET框架。無論如何,我堅持一個未處理的擴展元素的錯誤。代碼如下片段元素包含未處理的擴展元素'util:RegistrySearch'

<?xml version="1.0" encoding="utf-8"?> 
<!-- 
# This comment is generated by WixEdit, the specific commandline 
# arguments for the WiX Toolset are stored here. 

candleArgs: "<projectfile>" -ext WixBalExtension 
lightArgs: "<projectname>.wixobj" -ext WixBalExtension 
--> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" 
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> 

<Bundle UpgradeCode="80B0ECBE-CAAE-4B6A-9705-49F0232B0C24" 
     Version="0.0.1"> 
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" /> 
    <Chain> 
     <PackageGroupRef Id="Netfx45" /> 
    </Chain> 
</Bundle> 

<Fragment> 
    <util:RegistrySearch Root="HKLM" 
         Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" 
         Value="Version" 
         Variable="Netfx4FullVersion" /> 
    <util:RegistrySearch Root="HKLM" 
         Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" 
         Value="Version" 
         Variable="Netfx4x64FullVersion" 
         Win64="yes" /> 
    <!-- .NET 4.5 only installed if Vista or higher AND it's not already installed--> 
    <!-- .NET 4.5 only installed if Vista or higher AND it's not already installed-->  
<PackageGroup Id="Netfx45"> 
     <ExePackage Id="Netfx45" 
        Cache="no" 
        Compressed="yes" 
        PerMachine="yes" 
        Permanent="yes" 
        Vital="yes" 
        InstallCommand="/q" 
        SourceFile="C:\Users\ProRip\Downloads\dotnetfx45_full_x86_x64.exe" 
        DetectCondition="(Netfx4FullVersion=&quot;4.5.50709&quot;) AND (NOT VersionNT64 OR (Netfx4x64FullVersion=&quot;4.5.50709&quot;))" 
        InstallCondition="(VersionNT &gt;= v6.0 OR VersionNT64 &gt;= v6.0) AND (NOT (Netfx4FullVersion=&quot;4.5.50709&quot; OR Netfx4x64FullVersion=&quot;4.5.50709&quot;))" /> 
    </PackageGroup> 
</Fragment> 

錯誤消息

error CNDL0200 : The Fragment element contains an unhandled extension element 'util:RegistrySearch'. Please ensure that the extension for elements in the 'http://schemas.microsoft.com/wix/UtilExtension' namespace has been provided. 
error CNDL0200 : The Fragment element contains an unhandled extension element 'util:RegistrySearch'. Please ensure that the extension for elements in the 'http://schemas.microsoft.com/wix/UtilExtension' namespace has been provided 

誰能請解釋一下我的錯誤我已經包含了正確的命名空間,我不能看到該錯誤的原因!

+0

當你用蠟燭編譯你的代碼時,你是否'-ext WixUtilExtension'? –

+0

確定我已經將-xxt WixBalExtension更改爲WixUtilExtension,但現在我的默認引導程序應用程序出現錯誤未解決的引用符號'WixBootstrapperApplication:WixStandardBootstrapperApplication.RtfLicense' – codem

+0

您不應該替換,而是添加其他擴展名。像這樣:'-ext WixUtilExtension,WixBalExtension'。不過,我可能會誤解語法,只是玩它直到它工作 –

回答

26

名稱空間xmlns:util="http://schemas.microsoft.com/wix/UtilExtension的WiX擴展名是由名爲WixUtilExtension(假設您使用Visual Studio)的dll提供的。右鍵單擊項目中的引用節點,然後添加對WixUtilExtension dll的引用。

+1

謝謝。我會添加你也許可以從nuget獲得這些dll。 <?xml version =「1.0」encoding =「utf-8」?> 這對我的構建有幫助我沒有安裝Wix的機器(正如我在本地所做的那樣) – granadaCoder