2014-03-13 63 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