Пример #1
0
        static int Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
            var frmMain = new frmUpdate();
            //Debugger.Launch();

            Application.Run(frmMain);

            if (frmUpdate.s_Error is InstallationAbortException)
            {
                MessageBox.Show("The installation cannot continue:\r\n\r\n" + frmUpdate.s_Error.Message, SharedUpdateConstants.UPDATER_PROGRAM_NAME + " Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return 101;
            }
            else if (frmUpdate.s_Error is Exception)
            {
                MessageBox.Show("An unanticipated error has occured:\r\n\r\n" + frmUpdate.s_Error.Message, SharedUpdateConstants.UPDATER_PROGRAM_NAME + " Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return 102;
            }

            return 0;
        }
Пример #2
0
        static int Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
            var frmMain = new frmUpdate();

            //Debugger.Launch();

            Application.Run(frmMain);

            if (frmUpdate.s_Error is InstallationAbortException)
            {
                MessageBox.Show("The installation cannot continue:\r\n\r\n" + frmUpdate.s_Error.Message, SharedUpdateConstants.UPDATER_PROGRAM_NAME + " Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(101);
            }
            else if (frmUpdate.s_Error is Exception)
            {
                MessageBox.Show("An unanticipated error has occured:\r\n\r\n" + frmUpdate.s_Error.Message, SharedUpdateConstants.UPDATER_PROGRAM_NAME + " Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(102);
            }

            return(0);
        }