Search code examples
wixtypelibheat

WIX Candle.exe CNDL0047 : The TypeLib element is non-advertised and therefore requires a parent File element


I have run into issues with Wix when attempting to run Candle.exe for a few legacy 32-bit DLLs (ssubtmr.dll and cnewmenu.dll).

The heat commands look something like this (I don't think this is the issue):

heat.exe file C:\Blah\AddIns\Support\ssubtmr.dll -cg ssubtmr.dll -gg -g1 -sfrag -srd -svb6 -var var.AddinsSupport -dr AddinsSupport

The error produced by these files and these files alone (Not, for example, ssubtmr6.dll) is:

error CNDL0047 : The TypeLib element is non-advertised and therefore requires a parent File element.

I have spotted one fix for this which is to manually nest the TypeLib element inside the file element. This allows me to use candle to compile the generated *.wxs to a *.wixobj, but then when I run light.exe I get the following error:

error LGHT0311 : A string was provided with characters that are not available in the specified database code page '1252'. Either change these characters to ones that exist in the database's code page, or update the database's code page by modifying one of the following attributes: Product/@Codepage, Module/@Codepage, Patch/@Codepage, PatchCreation/@Codepage, or WixLocalization/@Codepage.

Here is what my wxs files look like (before I moved the lower TypeLib element underneath the File element):

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <DirectoryRef Id="AddinsSupport">
            <Component Id="cmp983054CCC56DD72D6D3F9BFD7ED0F8B5" Guid="7F4E338B-5F79-4F8A-B4E4-A36C9607A1CF">
                <File Id="fil5F0EEFBFCC94DFEB51EA7B7D3A19E268" KeyPath="yes" Source="$(var.AddinsSupport)\ssubtmr.dll">
                    <TypeLib Id="{5F7C62D4-9130-11D1-8E21-E08C04C10000}" Description="Subclassing and Timer Assistant (with configurable message response, multi-control support + timer bug fix)" HelpDirectory="AddinsSupport" Language="0" MajorVersion="8" MinorVersion="2">
                        <Class Id="{E779C863-9BEF-11D1-84DD-00C04FA4EE99}" Description="SSubTimer.ISubclass" Version="8.2" Programmable="yes">
                            <ProgId Id="SSubTimer.ISubclass" Description="SSubTimer.ISubclass" />
                        </Class>
                        <Class Id="{E779C867-9BEF-11D1-84DD-00C04FA4EE99}" Context="InprocServer32" Description="SSubTimer.GSubclass" ThreadingModel="apartment" Version="8.2" Programmable="yes">
                            <ProgId Id="SSubTimer.GSubclass" Description="SSubTimer.GSubclass" />
                        </Class>
                        <Class Id="{E779C869-9BEF-11D1-84DD-00C04FA4EE99}" Context="InprocServer32" Description="SSubTimer.CTimer" ThreadingModel="apartment" Version="8.2" Programmable="yes">
                            <ProgId Id="SSubTimer.CTimer" Description="SSubTimer.CTimer" />
                        </Class>
                        <Interface Id="{E52522D8-F165-11D1-8D49-00C04FA4EE99}" Name="GSubclass" ProxyStubClassId="{00020424-0000-0000-C000-000000000046}" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
                        <Interface Id="{E779C863-9BEF-11D1-84DD-00C04FA4EE99}" Name="ISubclass" ProxyStubClassId="{00020424-0000-0000-C000-000000000046}" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
                        <Interface Id="{E779C868-9BEF-11D1-84DD-00C04FA4EE99}" Name="CTimer" ProxyStubClassId="{00020424-0000-0000-C000-000000000046}" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
                        <Interface Id="{E779C86B-9BEF-11D1-84DD-00C04FA4EE99}" Name="CTimer" ProxyStubClassId="{00020420-0000-0000-C000-000000000046}" ProxyStubClassId32="{00020420-0000-0000-C000-000000000046}" />
                    </TypeLib>
                </File>
                <Interface Id="{E779C866-9BEF-11D1-84DD-00C04FA4EE99}" Name="GSubclass" ProxyStubClassId="{00020424-0000-0000-C000-000000000046}" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
                <Interface Id="{EFB7317B-F158-11D1-8D49-00C04FA4EE99}" Name="GSubclass" ProxyStubClassId="{00020424-0000-0000-C000-000000000046}" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
                <RegistryValue Root="HKCR" Key="CLSID\{E779C863-9BEF-11D1-84DD-00C04FA4EE99}\Implemented Categories\{40FC6ED5-2438-11CF-A3DB-080036F12502}" Value="" Type="string" Action="write" />
                <RegistryValue Root="HKCR" Key="CLSID\{E779C867-9BEF-11D1-84DD-00C04FA4EE99}\Implemented Categories\{40FC6ED5-2438-11CF-A3DB-080036F12502}" Value="" Type="string" Action="write" />
                <RegistryValue Root="HKCR" Key="CLSID\{E779C869-9BEF-11D1-84DD-00C04FA4EE99}\Implemented Categories\{40FC6ED5-2438-11CF-A3DB-080036F12502}" Value="" Type="string" Action="write" />
                <RegistryValue Root="HKCR" Key="Interface\{E779C866-9BEF-11D1-84DD-00C04FA4EE99}\Forward" Value="{E52522D8-F165-11D1-8D49-00C04FA4EE99}" Type="string" Action="write" />
                <RegistryValue Root="HKCR" Key="Interface\{EFB7317B-F158-11D1-8D49-00C04FA4EE99}\Forward" Value="{E52522D8-F165-11D1-8D49-00C04FA4EE99}" Type="string" Action="write" />
                <TypeLib Id="{97177EBC-0C54-11D0-B407-00AA00C14969}" Description="Visual Basic runtime objects and procedures" HelpDirectory="SystemFolder" Hidden="yes" Language="9" MajorVersion="5" MinorVersion="0">
                    <Interface Id="{14E469E0-BF61-11CF-8385-8F69D8F1350B}" Name="AsyncProperty" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
                    <Interface Id="{2CE46480-1A08-11CF-AD63-00AA00614F3E}" Name="SelectedControls" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
                    <Interface Id="{41A7D760-6018-11CF-9016-00AA0068841E}" Name="DataObject" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
                    <Interface Id="{41A7D761-6018-11CF-9016-00AA0068841E}" Name="DataObjectFiles" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
                    <Interface Id="{45046D60-08CA-11CF-A90F-00AA0062BB4C}" Name="PropertyBag" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
                    <Interface Id="{888A5A60-B283-11CF-8AD5-00A0C90AEA82}" Name="Hyperlink" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
                    <Interface Id="{B28FA150-0FF0-11CF-A911-00AA0062BB4C}" Name="AmbientProperties" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
                    <Interface Id="{BE8F9800-2AAA-11CF-AD67-00AA00614F3E}" Name="ParentControls" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
                    <Interface Id="{C0324960-2AAA-11CF-AD67-00AA00614F3E}" Name="ContainedControls" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
                    <Interface Id="{D4E0F020-720A-11CF-8136-00AA00C14959}" Name="DataBindings" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
                    <Interface Id="{D624E3E0-720A-11CF-8136-00AA00C14959}" Name="DataBinding" ProxyStubClassId32="{00020424-0000-0000-C000-000000000046}" />
                </TypeLib>
            </Component>
        </DirectoryRef>
    </Fragment>
    <Fragment>
        <ComponentGroup Id="AddinsSupport_ssubtmr.dll">
            <ComponentRef Id="cmp983054CCC56DD72D6D3F9BFD7ED0F8B5" />
        </ComponentGroup>
    </Fragment>
</Wix>

It's maybe worth noting that both the problematic DLLs contain the same TypeLib, "Visual Basic runtime objects and procedures".

I've read this, which suggests that I can maybe populate the TypeLib further, but I am at a loss as to how to do this.

Can anyone offer any suggestions? Thanks


Solution

  • The answer was completely unrelated to what I initially thought it was.

    Light.exe was failing because the .wixobj files had a Ü in it. Once I'd stripped this out (Stripped it from the .wxs files earlier in the process) everything built fine.