FRBDK/MasterInstaller/MasterInstaller/Program.cs
/// <summary>
/// The main entry point for the application.
/// </summary>
The main entry point for the application.
The main entry point for the application .
[STAThread]
        static void Main()
        {
            AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
            var args = Environment.GetCommandLineArgs();
#if !DEBUG
            if (!IsAdministrator)
            {
                args = args.Length > 1 ? SubArray(args, 1, args.Length - 1) : null;
                var process = new Process
                {
                    StartInfo = new ProcessStartInfo(Assembly.GetEntryAssembly().Location)
                    {
                        Verb = "runas",
                        Arguments = ConvertToArgString(args)
                    }
                };
                try
                {
                    process.Start();
                }
                finally
                {
                    Environment.Exit(0);
                }
            }
            else
#endif
            {
                try
                {
                    Application.EnableVisualStyles();
                    Application.SetCompatibleTextRenderingDefault(false);
                    Application.Run(new InstallForm());
                }
                catch(Exception e)
                {
                    ExceptionHandler.HandleException(e);
                }
            }
        }
[ STAThread ] static void Main ( ) { AppDomain . CurrentDomain . UnhandledException += CurrentDomain_UnhandledException ; var args = Environment . GetCommandLineArgs ( ) ; if ! DEBUG if ( ! IsAdministrator ) { args = args . Length > 1 ? SubArray ( args , 1 , args . Length - 1 ) : null ; var process = new Process { StartInfo = new ProcessStartInfo ( Assembly . GetEntryAssembly ( ) . Location ) { Verb = " " , Arguments = ConvertToArgString ( args ) } } ; try { process . Start ( ) ; } finally { Environment . Exit ( 0 ) ; } } else endif { try { Application . EnableVisualStyles ( ) ; Application . SetCompatibleTextRenderingDefault ( false ) ; Application . Run ( new InstallForm ( ) ) ; } catch ( Exception e ) { ExceptionHandler . HandleException ( e ) ; } } }
The main entry point for the application.
The main entry point for the application .