-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I have a performance counter DLL I need to deploy and register.
Internally this is handled with regsvr32. This dll is, as far as I can
determine, /not/ self registering.
How do I register the performance counters in this DLL? If it were
self-reg I could run tallow over it to extract the reg data and ref that
fragment at build-time.
I've read posts where people suggest using regsvr32 and then collecting
the registry keys by hand, but I haven't the faintest idea where to
start with this approach. What would be a good reference that discusses
this technique?
Performance counters don't work like that -- they are unfortunately
rather more complicated than poking a few registry values in. All of
the performance data strings are stored in a pair of registry keys, one
for counter names & one for help, and this really makes installation an
enjoyable game ;)
The WiX supported method is to generate a .h/.ini file pair as you would
for the "lodctr" tool. In WiX you then just do something like:
<File Id="PerfCtrs.h" Name="PerfCs.h" Source="PerfCtrs.h" />
<File Id="PerfCtrs.ini" Name="PerfCtrs.ini" Source="PerfCtrs.ini">
<util:PerfCounter Name="ServiceName" />
</File>
and add xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" to
the Wix element. Maybe you also need:
candle -ext Microsoft.Tools.WindowsInstallerXml.PcaCompiler,pcaext foo.wxs
light -ext Microsoft.Tools.WindowsInstallerXml.PcaCompiler,pcaext
foo.wixobj "C:\program files\windows installer xml\bin\sca.wixlib"
"C:\program files\windows installer xml\bin\pubca.wixlib" "C:\program
files\windows installer xml\bin\wixui.wixlib" -loc "C:\program
files\windows installer xml\bin\WixUI_en-us.wxl" -out foo.msi
or maybe it isn't in the pubca library (sorry I can't remember off hand,
that might just be for the COM+ stuff -- I have lifted it from a working
installer that includes both performance counters and COM+).
You would have to get the developer to provide you with .h/.ini files
for the application (btw, they also support localisation, if that is any
use to you). If the perf counter support is based on something like
Richter's code samples it may be preferable to write something to
generate these files automatically (I did, I have quite a few programs
that implement performance counters, and the framework with perf counter
extraction code is here:
http://www.blushingpenguin.com/mark/blog/?page_id=4
maybe there is something that can be borrowed, maybe not. It's not
_quite_ Richter's code though, as I wasn't clear on the licensing
issues, I just wrote it from scratch).
Alternatively you could fall back and make the DLL self register at
install time -- although that's not the MSI way -- it should be avoided
as it breaks the 'installation as a transaction' concept.
Well that was as bit long, hope it helped some!
Mark