Reputation: 1001
I have a custom bootstrapper using burn, in which I have to detect the driver version of a specific printer on startup and store this value in a burn variable for later usage. Until now, I did this in the overriden Run
method of BootstrapperApplication
, but I would rather create a WixExtension
, to be able to do something like this:
<customUtil:PrinterDriverVersion PrinterName="somePrinter"
Variable="variableToStoreVersionValue" />
This would be similar to the RegistrySearch
element in wix's UtilExtension
.
There is an example of a CompilerExtension
in the book "WiX 3.6: A Developer's Guide To Windows Installer XML", but I don't get it. Why do I need a new msi table? I just want to use that in burn, not in an msi installer?
I looked at the source code of wix, trying to understand, how the RegistrySearch
element works. So UtilCompiler
just parses the xml attributes and then creates some rows in the WixRegistrySearch
table. This table gets iterated by the binder, who writes all searches in the BurnManifest
and then creates the resulting output file (.exe). But when and where do this searches get executed at runtime?
Is a CompilerExtension
capable to get my task done, or am I on the wrong way?
Upvotes: 0
Views: 264
Reputation: 7878
WiX doesn't have this functionality today. This use case is also needed for the VSExtension to support installing VSIX packages into VS2017 with a bundle, since code needs to be executed to detect VS2017 instances. I created a feature request here.
The UtilExtension searches are special. As you said, they end up in the BurnManifest. The code that executes the searches is in the Burn engine.
Upvotes: 1