/// <summary>
        /// The entry point for our code
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            Hide();

            try
            {
                InstallationEngine engine = new InstallationEngine(ProductName, SafelyGetAppInstalledPath());
                engine.PerformInstallation();
            }
            catch (Exception e)
            {
                EventLogger.WriteErrorMessage(e.ToString());
                ExceptionReporter.ReportException(e);
                MessageBox.Show(e.Message, "An error occurred during install");
            }

            Close();
        }
Example #2
0
        public void SwitchVersionAndInvokeCloseApplication()
        {
            string errorMessage = null;

            try
            {
                InstallationEngine engine = new InstallationEngine(ProductName, SafelyGetAppInstalledPath());
                engine.PerformInstallation(DispatcherUpdateProgress);
            }
#pragma warning disable CA1031 // Do not catch general exception types
            catch (Exception e)
            {
                EventLogger.WriteErrorMessage(e.ToString());
                ExceptionReporter.ReportException(e);
                errorMessage = e.Message;
            }
#pragma warning restore CA1031 // Do not catch general exception types

            Dispatcher.Invoke(() => CloseAppliction(errorMessage));
        }
        /// <summary>
        /// The entry point for our code
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();
            Hide();

            try
            {
                InstallationEngine engine = new InstallationEngine(ProductName, SafelyGetAppInstalledPath());
                engine.PerformInstallation();
            }
#pragma warning disable CA1031 // Do not catch general exception types
            catch (Exception e)
            {
                EventLogger.WriteErrorMessage(e.ToString());
                ExceptionReporter.ReportException(e);
                MessageBox.Show(e.Message, "An error occurred during install");
            }
#pragma warning restore CA1031 // Do not catch general exception types

            Close();
        }