21

Learning how to create Wix Booloader so that I can install .NET framework with my msi install package. Anyway I am stuck with an error for an unhandled extension element. Code is below

<?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 message is

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

Can anyone please explain what my error is I have included the correct namespace and I can't see a reason for the error!

codem
  • 283
  • 1
  • 2
  • 9
  • 4
    When you compile your code with candle, do you `-ext WixUtilExtension`? – Yan Sklyarenko Mar 13 '14 at 13:59
  • ok I have changed the -ext WixBalExtension to WixUtilExtension but now I have error with default bootstrapper application Unresolved reference to symbol 'WixBootstrapperApplication:WixStandardBootstrapperApplication.RtfLicense' – codem Mar 14 '14 at 14:08
  • You should not replace, but add another extension. Like this: `-ext WixUtilExtension,WixBalExtension`. I might be mistaken with syntax, though - just play with it until it works – Yan Sklyarenko Mar 14 '14 at 14:11
  • 1
    thanks heaps its done now, I was trying a few combinations to get multiple extensions to work. It turns out that it needs to be "-ext WixBalExtension -ext WixUtilExtension" I gave up before as I was unsure that I was able to use multiple extensions. – codem Mar 14 '14 at 14:17

1 Answers1

54

The WiX extension for the namespace xmlns:util="http://schemas.microsoft.com/wix/UtilExtension is provided by a dll named WixUtilExtension (this assuming you are using Visual Studio). Right-click on the References node in your project and add a reference to the WixUtilExtension dll.

Robert
  • 5,278
  • 43
  • 65
  • 115
user3628987
  • 576
  • 6
  • 6
  • 2
    Thanks. I'll add you may be able to get these dll's from nuget as well. This helps on my build machine where I haven't installed Wix (as I did locally) – granadaCoder Feb 01 '17 at 18:57
  • 1
    also if you are running on the commandline, you need to add `-ext WiXNetFxExtension` to your `light` call and maybe the `candle` call, too. https://wixtoolset.org/documentation/manual/v3/howtos/general/extension_usage_introduction.html – phyatt Aug 28 '19 at 16:34
  • I meant `-ext WixUtilExtension`. – phyatt Aug 28 '19 at 16:52