WiX includes functionality to call the LoadPerfCounterTextStrings and
UnloadPerfCounterTextStrings APIs and create the registry entries required.
See the PerformanceCategory and PerformanceCounter elements in the Util
schema. This feature is new in WiX v3.0.

 

If still using WiX 2.0, you can instead specify an INI file which contains
the counter information, which in turn includes a header file which defines
the order of the names. This is in fact what .NET does internally when you
call PerformanceCounterCategory.Create - it's the only supported method of
doing it - but they have failed to provide a way to export the INI and
header files, such as you might need to do if, I don't know, you were
building an installer! .NET actually runs the lodctr.exe program, which has
shipped with Windows since at least Windows 2000 I believe (it might have
been a resource kit tool in NT 4.0, it certainly was before that), whereas
WiX currently calls the APIs which were only added in Windows 2000.

 

If you want to build a horrible hack tool using reflection <g>, see
System.Diagnostics.PerformanceCounterLib.CreateSymbolFile and CreateIniFile
in System.dll. Sadly PerformanceCounterLib is declared 'internal' while both
methods are declared 'private', that's why you'd have to use reflection.
You'd also have to add the required registry entries yourself, see the
CreateRegistryEntry method for what needs to be added. Still, I'd much
prefer doing this than some messy managed custom action lashup. Or you could
simply see the code in src\ext\UtilExtension\wixext\UtilCompiler.cs from WiX
v3.0 in the ParsePerformanceCategoryElement method.

 

-- 

Mike Dimmick

 

  _____  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Daniel
Doubrovkine
Sent: 22 October 2007 22:30
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] custom action executing managed executables

 

Dear all,

 

I read robmen's article on managed custom actions. I have an installer type
activity to execute that I must do during installation (installing
performance counters). You need to be admin to do that, so I have to run it
within the installation.

 

We want to execute the InstallPerfCounters.exe with a CA, which works easily
with a CustomAction. Unfortunately you don't get any feedback except success
and failure. I'd like InstallPerfCounters.exe to log back.

 

So I thought of a simple solution: implement a C++ custom action that spawns
InstallPerfCounters.exe, hooks up to its stdout and logs all lines into the
MSI log using the MSI API. Thus anything that InstallPerfCounters.exe
outputs will appear in the log.

 

Has anyone done something like this? Is this a good/bad/crazy idea?

 

Thx

dB.

 

Daniel Doubrovkine (dB.)

Development Manager & Lead Architect
Application Security Inc.

appsecinc.com <http://www.appsecinc.com/> 

 

 

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to