Tuesday, October 25, 2005

Hooking into the perfcounter installer..

It is surprising how often you find uses for a tip that you get. Case in point: IFEO.

I never heard/nor felt its need in 3.5 years at my previous job. But these days I seem to use it fairly often!

Dotnet has this PerformanceCounterInstaller class where you define various attributes and counters that you want to expose for you app. Then call installutil to install it.

However, installutil is not used in production setups as selfreg has a whole range of issues to handle and the unmanaged equivalents (lodctr stuff via provided custom actions in the setup tools) are generally used.

So for setup we needed to figure out the dotnet specific registry entries + the ini files that we give to lodctr. Setup the debugger to launch on invocation of lodctr by:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\lodctr.exe]
"Debugger"="c:\\debuggers\\windbg.exe "

Then invoked installutil. This gets the lodctr invoked by installutil into the debugger and you have all the time to figure out that .net internally creates the ini files in the %temp% directory :) Figuring out the additional reg entries was a matter of inspection...

No comments: