AAA.Program.InstallPnkBstr C# (CSharp) Метод

InstallPnkBstr() статический приватный метод

static private InstallPnkBstr ( OptionSet p, string pnkbstrFile, string serviceName ) : void
p OptionSet
pnkbstrFile string
serviceName string
Результат void
        static void InstallPnkBstr(OptionSet p, string pnkbstrFile, string serviceName)
        {
            if (ServiceTools.ServiceInstaller.ServiceIsInstalled(serviceName))
            {
                Console.WriteLine("Service is already installed!");
                return;
            }
            try
            {
                ServiceTools.ServiceInstaller.Install(serviceName, serviceName, pnkbstrFile);
                Console.WriteLine("Service Installed!");
            }
            catch (System.ApplicationException e)
            {
                Console.WriteLine("Error installing service (do you have proper privileges?): {0}", e.Message);
            }
        }