예제 #1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            var commandLine = new CommandLine(args);

            if (commandLine.RunAsService)
            {
                ServiceBase[] servicesToRun = new ServiceBase[] { new ShredHostService() };
                ServiceBase.Run(servicesToRun);
            }
            else if (!String.IsNullOrEmpty(commandLine.PreviousExeConfigurationFilename))
            {
                var groups = SettingsGroupDescriptor.ListInstalledSettingsGroups(SettingsGroupFilter.LocalStorage);
                foreach (var group in groups)
                {
                    SettingsMigrator.MigrateSharedSettings(group, commandLine.PreviousExeConfigurationFilename);
                }

                ShredSettingsMigrator.MigrateAll(commandLine.PreviousExeConfigurationFilename);
            }
            else
            {
                Thread.CurrentThread.Name = "Main thread";
                if (!ManifestVerification.Valid)
                {
                    Console.WriteLine("The manifest detected an invalid installation.");
                }
                ShredHostService.InternalStart();
                Console.WriteLine("Press <Enter> to terminate the ShredHost.");
                Console.WriteLine();
                Console.ReadLine();
                ShredHostService.InternalStop();
            }
        }
예제 #2
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            var commandLine = new CommandLine(args);

            if (commandLine.RunAsService)
            {
                var ServicesToRun = new ServiceBase[] { new ShredHostService() };
                ServiceBase.Run(ServicesToRun);
            }
            else if (!String.IsNullOrEmpty(commandLine.PreviousExeConfigurationFilename))
            {
                var groups = SettingsGroupDescriptor.ListInstalledLocalSettingsGroups();
                groups.Add(new SettingsGroupDescriptor(typeof(ShredSettingsMigrator).Assembly.GetType("ClearCanvas.Server.ShredHost.ShredHostServiceSettings")));
                foreach (var group in groups)
                {
                    SettingsMigrator.MigrateSharedSettings(group, commandLine.PreviousExeConfigurationFilename);
                }

                ShredSettingsMigrator.MigrateAll(commandLine.PreviousExeConfigurationFilename);
            }
            else
            {
                ShredHostService.InternalStart();
                Console.WriteLine("Press <Enter> to terminate the ShredHost.");
                Console.WriteLine();
                Console.ReadLine();
                ShredHostService.InternalStop();
            }
        }