Not pretty but this works:
            Assembly assembly = Assembly.GetCallingAssembly();
            FileVersionInfo fvi = 
FileVersionInfo.GetVersionInfo(assembly.Location);
            Console.WriteLine("Version {0}", fvi.FileVersion);

That'll do until I find a better solution.

Since you need to reference wix.dll in your extension, try the following:

1. Call System.Reflection.Assembly.GetReferencedAssemblies to get array of 
AssemblyName objects
2. Enumerate through the array looking for WIX assembly,
3. Check the Version property of AssemblyName object associated with wix.dll

Cheers,
Maciej

From: Neil Sleightholm<mailto:n...@x2systems.com>
Sent: Thursday, October 04, 2012 12:27 PM
To: Windows Installer XML toolset developer mailing 
list<mailto:wix-devs@lists.sourceforge.net>
Subject: Re: [WiX-devs] OnDetectRelatedBundle() in 3.7

Is it possible to detect the WiX toolset version inside the extension so it can 
fail at build time rather than runtime?

Yes, very much a downside. Shipping a single BA is not possible... just like 
the old days with WiX extensions (which still happens when new major versions 
of WiX toolset come out).



On Wed, Oct 3, 2012 at 11:49 PM, Neil Sleightholm 
<n...@x2systems.com<mailto:n...@x2systems.com>> wrote:
Ok fair enough, thought I'd ask though as I have just release a BA in to the 
wild!

Neil

At this point in time, BA's need to be recompiled when moving from one version 
of WiX toolset to the next. Still too early in the lifecycle of Burn to start 
making binary backwards compatibility a goal.

On Wed, Oct 3, 2012 at 7:36 PM, Bob Arnson 
<b...@joyofsetup.com<mailto:b...@joyofsetup.com>> wrote:
On 03-Oct-12 16:24, Neil Sleightholm wrote:
A change has been made to the burn engine OnDetectRelatedBundle() method in 
version 3.7 to add the parameter relationType; am I correct that this is a 
breaking and will mean that BA written against v3.6 won’t work in v3.7?

If I am correct could this change be moved to a new function so it is 
non-breaking?
Yes, it's a breaking change and not the only one. Either approach (new 
parameter or new function) would be a breaking binary change. The COM-crazy way 
would be to add a new interface but that's how you end up with IFooEx2 
interfaces.<shudder>

--
sig://boB
http://joyofsetup.com/

------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
WiX-devs mailing list
WiX-devs@lists.sourceforge.net<mailto:WiX-devs@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/wix-devs




--
virtually,

   Rob Mensching
   http://RobMensching.com LLC


------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
WiX-devs mailing list
WiX-devs@lists.sourceforge.net<mailto:WiX-devs@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/wix-devs




--
virtually,

   Rob Mensching
   http://RobMensching.com LLC


________________________________
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev

________________________________
_______________________________________________
WiX-devs mailing list
WiX-devs@lists.sourceforge.net<mailto:WiX-devs@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/wix-devs
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
WiX-devs mailing list
WiX-devs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-devs

Reply via email to