public void RunApplication(string[] args)
		{
			var cmdLine = new GetSettingCommandLine();
			try
			{
				cmdLine.Parse(args);

				using (new AuthenticationScope(cmdLine.UserName, "setup", Dns.GetHostName(), cmdLine.Password))
				{

					ISettingsStore store;
					try
					{
						store = SettingsStore.Create();
						//If there is a store, and it is not online, then settings can't be edited.
						if (!store.IsOnline)
						{
							Platform.Log(LogLevel.Error, "Settings Store is not online, cannot update configuration");
							return;
						}
					}
					catch (NotSupportedException)
					{
						// There is no central settings store; all settings will be treated as though they were local.
						Platform.Log(LogLevel.Error, "No Enterprise settings store, cannot update configuration");
						return;
					}

					var setting = new SettingDefinition
									{
										Group = cmdLine.SettingGroup,
										Property = cmdLine.SettingName,
										Version = cmdLine.Version,
									};

					SetupHelper.ExportSettingsDefinition(store, setting, cmdLine.SettingData);
				}
			}
			catch (CommandLineException e)
			{
				Console.WriteLine(e.Message);
				Platform.Log(LogLevel.Error, e, "Command line error.");
			}
		}
        public void RunApplication(string[] args)
        {
            var cmdLine = new GetSettingCommandLine();

            try
            {
                cmdLine.Parse(args);

                using (new AuthenticationScope(cmdLine.UserName, "setup", Dns.GetHostName(), cmdLine.Password))
                {
                    ISettingsStore store;
                    try
                    {
                        store = SettingsStore.Create();
                        //If there is a store, and it is not online, then settings can't be edited.
                        if (!store.IsOnline)
                        {
                            Platform.Log(LogLevel.Error, "Settings Store is not online, cannot update configuration");
                            return;
                        }
                    }
                    catch (NotSupportedException)
                    {
                        // There is no central settings store; all settings will be treated as though they were local.
                        Platform.Log(LogLevel.Error, "No Enterprise settings store, cannot update configuration");
                        return;
                    }

                    var setting = new SettingDefinition
                    {
                        Group    = cmdLine.SettingGroup,
                        Property = cmdLine.SettingName,
                        Version  = cmdLine.Version,
                    };

                    SetupHelper.ExportSettingsDefinition(store, setting, cmdLine.SettingData);
                }
            }
            catch (CommandLineException e)
            {
                Console.WriteLine(e.Message);
                Platform.Log(LogLevel.Error, e, "Command line error.");
            }
        }