1

Closed

InstallUtil

description

Hi, I would like to be able to install PerfConuters using InstallUtil utility instead of executable Installer of the project.
Closed Apr 17, 2009 at 3:10 PM by javiercanillas
Closed. See my comment for the resolution.

comments

javiercanillas wrote Apr 17, 2009 at 3:09 PM

Ups.. i haven't checked the issue tracker. There should be an email notifier about this.
Ok, what you can do to achieve this, is making a Proyectinstaller class in your application that does the following:
        Type[] performanceCounterTypes = PerformanceHelper.GetPerformanceCounterFromAssembly(assemblyLoaded);

        if (performanceCounterTypes.Length != 0)
        {
            bool succeded = true;
            foreach (Type performanceCounterType in performanceCounterTypes)
            {
                try
                {
                    PerformanceHelper.Install(performanceCounterType);
                }
                catch (Exception oEx)
                {
                    //Do exception handling stuff
                    succeded = false;
                    break;
                }
            }
        }
What i think you might need is the code to unregister the counters in case you call the installutil /u. I haven't added this functionality to my installer yet. I will try to add it as soon as posible.

Let me know if this works for you.

wrote Apr 17, 2009 at 3:10 PM

wrote Feb 14, 2013 at 2:43 AM

wrote May 16, 2013 at 7:54 AM