コード例 #1
0
ファイル: Program.cs プロジェクト: spraints/svn2tfs
        /// <summary>
        /// The main entry point for the application.
        /// </summary>        
        static void Main()
        {
            if (Environment.CommandLine.Contains("-service"))
            {
                if (ServiceCheck(true) == false)
                {
                    ServiceController controller = new ServiceController(applicationName);
                    controller.Start();
                    return;
                }

                ServiceBase[] services = new ServiceBase[] { new ServiceWrapper() };
                ServiceBase.Run(services);
            }
            else if (Environment.CommandLine.Contains("-removeservice"))
            {
                if (ServiceCheck(false))
                {
                    ServiceController controller = new ServiceController(applicationName);
                    if (controller.Status == ServiceControllerStatus.Running) controller.Stop();
                    ServiceInstaller.UnInstallService(applicationName);
                }
            }
            else
            {
                ConsoleApplication application = new ConsoleApplication(applicationPath, true);
            }
        }
コード例 #2
0
ファイル: ServiceWrapper.cs プロジェクト: spraints/svn2tfs
 protected override void OnStart(string[] args)
 {
     string applicationPath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
     application = new ConsoleApplication(applicationPath, false);
 }
コード例 #3
0
        protected override void OnStart(string[] args)
        {
            string applicationPath = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);

            application = new ConsoleApplication(applicationPath, false);
        }