Exemplo n.º 1
0
        public void RunApplication(string[] args)
        {
            var cmdLine = new SetupCommandLine();

            try
            {
                cmdLine.Parse(args);

                using (new AuthenticationScope(cmdLine.UserName, "setup", Dns.GetHostName(), cmdLine.Password))
                {
                    // first import the tokens, since the default groups will likely depend on these tokens
                    if (cmdLine.ImportAuthorityTokens)
                    {
                        SetupHelper.ImportAuthorityTokens(new[] { BuiltInAuthorityGroups.Administrators.Name });
                    }

                    // import authority groups
                    if (cmdLine.ImportDefaultAuthorityGroups)
                    {
                        SetupHelper.ImportEmbeddedAuthorityGroups();
                    }

                    if (!string.IsNullOrEmpty(cmdLine.AuthorityGroupData))
                    {
                        SetupHelper.ImportAuthorityGroups(cmdLine.AuthorityGroupData);
                    }

                    // import settings groups
                    if (cmdLine.ImportSettingsGroups)
                    {
                        ImportSettingsGroups();
                    }

                    if (cmdLine.MigrateSharedSettings)
                    {
                        MigrateSharedSettings(cmdLine.PreviousExeConfigFilename);
                    }
                }
            }
            catch (CommandLineException e)
            {
                Console.WriteLine(e.Message);
            }
        }
Exemplo n.º 2
0
		public void RunApplication(string[] args)
		{
			var cmdLine = new SetupCommandLine();
			try
			{
				cmdLine.Parse(args);

				using (new AuthenticationScope(cmdLine.UserName, "setup", Dns.GetHostName(), cmdLine.Password))
				{
					// first import the tokens, since the default groups will likely depend on these tokens
					if (cmdLine.ImportAuthorityTokens)
					{
						SetupHelper.ImportAuthorityTokens(new[] { BuiltInAuthorityGroups.Administrators.Name });
					}

					// import authority groups
					if (cmdLine.ImportDefaultAuthorityGroups)
					{
						SetupHelper.ImportEmbeddedAuthorityGroups();
					}

					if(!string.IsNullOrEmpty(cmdLine.AuthorityGroupData))
					{
						SetupHelper.ImportAuthorityGroups(cmdLine.AuthorityGroupData);
					}

					// import settings groups
					if (cmdLine.ImportSettingsGroups)
					{
						ImportSettingsGroups();
					}

					if (cmdLine.MigrateSharedSettings)
					{
						MigrateSharedSettings(cmdLine.PreviousExeConfigFilename);
					}
				}
			}
			catch (CommandLineException e)
			{
				Console.WriteLine(e.Message);
			}
		}