Blair, Yes I have the tables.xml correctly referenced as described above. The error has disappeared. If this pattern is idiomatic for this type of extension, I'm happy.
My points above were * The only widely available documentation for this appears to have an error * It would have been better if WiX had not thrown this error and instead simply thrown the second reference away (I can't see any way this might be dangerous, since a reference is just a reference). If I'm missing anything with either of those points, please let me know. If I have any further questions, I'll be back in touch :) Thanks for your help John On 10 July 2013 15:51, Blair Murri <os...@live.com> wrote: > John, > > Yes, you put the wixlib only into the extension, and that allows you to > have your setup project only reference the extension and not the wixlib > directly. > > The setup project references the extension in a similar fashion to the > toolset-supplied extensions, except that the path (including the .dll at > the end of the filename) need to be supplied (done for you by Votive). > > I haven't looked that the example in the book (yet). > > You supply the table definitions by overriding the TableDefinitions > property similar to this: > > private TableDefinitionCollection tableDefinitions; > public override TableDefinitionCollection TableDefinitions > { > get > { > if (null == this.tableDefinitions) > { > this.tableDefinitions = > LoadTableDefinitionsHelper(Assembly.GetExecutingAssembly(), > "<assembly-resource-prefix>.tables.xml"); > } > return this.tableDefinitions; > } > } > > (looks very similar to the code used to supply the wixlib -- the > GetLibrary() override you had to use to have the extension supply your > wixlib) > > You place the tables.xml file into your managed resources a similar way as > you do your wixlib. > > The tables.xml file uses the tableDefinitions schema ( > http://schemas.microsoft.com/wix/2006/tables), the xsd of which is only > in the sources (src\wix\Xsd\tables.xsd). Only supply attributes that are > not required if you need to override the default value. The TablesYesNoType > type defaults to "no", and most of the attributes come from MSDN and end up > in the table validation > metadata. > > Blair > > > From: john.ludlow...@gmail.com > > Date: Wed, 10 Jul 2013 15:20:56 +0100 > > To: wix-users@lists.sourceforge.net > > Subject: Re: [WiX-users] Duplicate symbol when using > CompilerCore.CreateWixSimpleReferenceRow > > > > Hi Blair, > > > > Ok, does that mean I've encountered an error in the book, then? The book > > suggests adding the wixlib to the extension, and I've done that (means I > > should only have to reference the extension, not the wixlib, right?). > > > > However, the sample code in the book does not come with a test install > > which shows how to reference it, nor is this discussed in the book in any > > detail. I was going to create one but have not had the time yet, so I'm > not > > sure if the code in the book works or not. (Wouldn't be the first time > I've > > come across sample code in a book that doesn't compile). > > > > I got that the extension needs to be supplied to both (though, honestly, > > it's a bit annoying having to propagate the references). That's obviously > > why the first error appeared. > > > > It made sense that this was because I was referencing it twice, but I > > figured the book was probably correct and I was missing something (and I > > didn't want to just remove the line so it worked "temporarily"). It would > > probably be a good improvement to have this behave like I described > above - > > you can only declare something once, but you can create as many > references > > as you like to it, even if those references are technically duplicates of > > each other. > > > > In the meantime, I'll remove that line. > > > > Thanks > > > > PS: I'm still planning to write this up as a tutorial, but I just want to > > get stuff like this sorted first > > > > > > On 10 July 2013 14:46, Blair Murri <os...@live.com> wrote: > > > > > A WixExtension used in the way you describe usually supplies three > things: > > > a CompilerExtension (to parse your new elements and attributes), a > Table > > > definition (comes from a tables.xml-style file with the definitions of > the > > > tables unique to your extension), and a binary-wixlib (containing your > CAs > > > and related authoring). > > > > > > Usually your CompilerExtension will supply two things: references to > items > > > in your wixlib, and rows into your tables (from the authoring you > parse). > > > Those rows are not part of your wixlib. > > > > > > CreateWixSimpleReferenceRow creates a reference to a row that needs to > be > > > supplied from elsewhere, usually the wixlib supplied by the extension. > > > > > > If the WixExtension supplies the wixlib, you don't need to supply it. > > > Also, if the WixExtension supplies the table definitions (via the > > > tables.xml-style file), you don't need to duplicate the table > definitions > > > in your wixlib (using CustomTable elements). > > > > > > Also, make sure that your extension is supplied to both candle and > light > > > in your build script. > > > > > > I would guess that you are missing the tables.xml-style reference in > your > > > WixExtension (which I suspect is the source of your "missing" error), > and > > > that you are supplying the wixlib used in your extension directly to > your > > > setup project (which I suspect is the source of your duplicate symbol). > > > > > > > From: john.ludlow...@gmail.com > > > > Date: Wed, 10 Jul 2013 12:25:38 +0100 > > > > To: wix-users@lists.sourceforge.net > > > > Subject: [WiX-users] Duplicate symbol when using > > > CompilerCore.CreateWixSimpleReferenceRow > > > > > > > > Hi, > > > > > > > > My installer has two projects - a Setup Project which emits an .MSI > and > > > > contains install metadata, and a Setup Library Project which emits a > > > > .wixlib which contains install components. The latter makes use of a > > > > compiler extension which generates an MSI table based on some child > > > > elements of the File element. In other words, it looks like this: > > > > > > > > <File> > > > > <myext:MyFunkyExtension/> > > > > </File> > > > > > > > > (attributes omitted for brevity) > > > > > > > > The extension consists of three projects: a C# class library for the > > > actual > > > > extension, a C++ Custom Action Library for the custom actions that > will > > > use > > > > the data in the table, and a wixlib to hold the custom action > definition. > > > > The CA DLL is bound into the wixlib, and the wixlib is included in > the > > > > extension dll project as an embedded resource. > > > > > > > > Now here comes the issue... > > > > > > > > When I reference the extension DLL from just the wixlib which has the > > > > components in, I get this error: > > > > > > > > Error 1 Cannot find the table definitions for the 'MyTable' table. > This > > > is > > > > likely due to a typing error or missing extension. Please ensure > all the > > > > necessary extensions are supplied on the command line with the -ext > > > > parameter. light.exe 0 1 MyInstall > > > > > > > > I wondered if the setup project needed the reference as well, but > when I > > > > add that I get this: > > > > Error 1 Duplicate symbol 'CustomAction:MyCA' found. This typically > means > > > > that an Id is duplicated. Check to make sure all your identifiers of > a > > > > given type (File, Component, Feature) are unique. > > > > MyComponentSetupLibrary.wixlib 0 1 MyInstall > > > > > > > > I reckon this is down to this code at the end of the ParseElement > methjod > > > > in the extension: > > > > > > > > Core.CreateWixSimpleReferenceRow(ln, "CustomAction", "MyCA"); > > > > I did this on the suggestion of the Wix 3.6 Development Guide > (Chapter > > > 14) > > > > in order to create a reference to the action in order to pull the > > > fragment > > > > into the installation. > > > > > > > > I also noticed that my ParseElement method seems to get called > twice. Is > > > > this because I have 2 references from my projects (one from my setup > > > > project and one from my setup library project)? This is odd - I > thought > > > you > > > > could reference things as many times as you liked in this manner, > and if > > > it > > > > was already there then it would just ignore it. > > > > > > > > Any hints would be greatly appreciated. > > > > > > > > Thanks > > > > > > > > John > > > > > > > > ------------------------------------------------------------------------------ > > > > See everything from the browser to the database with AppDynamics > > > > Get end-to-end visibility with application monitoring from > AppDynamics > > > > Isolate bottlenecks and diagnose root cause in seconds. > > > > Start your free trial of AppDynamics Pro today! > > > > > > > > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > > > > _______________________________________________ > > > > WiX-users mailing list > > > > WiX-users@lists.sourceforge.net > > > > https://lists.sourceforge.net/lists/listinfo/wix-users > > > > > > > > > > ------------------------------------------------------------------------------ > > > See everything from the browser to the database with AppDynamics > > > Get end-to-end visibility with application monitoring from AppDynamics > > > Isolate bottlenecks and diagnose root cause in seconds. > > > Start your free trial of AppDynamics Pro today! > > > > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > > > _______________________________________________ > > > WiX-users mailing list > > > WiX-users@lists.sourceforge.net > > > https://lists.sourceforge.net/lists/listinfo/wix-users > > > > > > ------------------------------------------------------------------------------ > > See everything from the browser to the database with AppDynamics > > Get end-to-end visibility with application monitoring from AppDynamics > > Isolate bottlenecks and diagnose root cause in seconds. > > Start your free trial of AppDynamics Pro today! > > > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > > _______________________________________________ > > WiX-users mailing list > > WiX-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/wix-users > > > ------------------------------------------------------------------------------ > See everything from the browser to the database with AppDynamics > Get end-to-end visibility with application monitoring from AppDynamics > Isolate bottlenecks and diagnose root cause in seconds. > Start your free trial of AppDynamics Pro today! > http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk > _______________________________________________ > WiX-users mailing list > WiX-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wix-users > ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users