shadyreal 0 Newbie Poster

A bit of background information:

Im running Windows Server 2008 R2 Standard, on a virtual server.

The program is a service with a service installer. The service has a couple of performance counters to show the data performance. To be able to do this I need to create a category(I know how). It should be able to do so on other computers.

The thing is that I can't create a category without admin rights. And now I am doing it on the service OnStart function. Wich does not work. As I start the service it fails if there is no category.

I have searched a lot and found out that I need to setup the category on the installation.

How do I do that? To make the installer create the category needed.

MSDN:

It is strongly recommended that new performance counter categories be created during the installation of the application, not during the execution of the application. This allows time for the operating system to refresh its list of registered performance counter categories. If the list has not been refreshed, the attempt to use the category will fail.