Пример #1
0
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            bool uninstall = false;
            bool passive   = false;

            foreach (string arg in Environment.GetCommandLineArgs())
            {
                if ((string.Compare(arg, "/uninstall", true) == 0) ||
                    (string.Compare(arg, "-uninstall", true) == 0) ||
                    (string.Compare(arg, "--uninstall", true) == 0))
                {
                    uninstall = true;
                }
                if ((string.Compare(arg, "/passive", true) == 0) ||
                    (string.Compare(arg, "-passive", true) == 0) ||
                    (string.Compare(arg, "--passive", true) == 0))
                {
                    passive = true;
                }
            }
            LoadVendorCustomizer(passive);
            if (uninstall)
            {
                if (passive)
                {
                    ProgressWindow progressWindow = new ProgressWindow();
                    progressWindow.UninstallMode = true;
                    progressWindow.PassiveMode   = true;
                    progressWindow.Show();
                }
                else
                {
                    MessageBoxResult Confirm = MessageBox.Show(
                        string.Format(InstallerStrings.UninstallQuestion, InstallerStrings.ProductName),
                        InstallerStrings.InstallerName,
                        MessageBoxButton.YesNo,
                        MessageBoxImage.Question
                        );
                    if (Confirm == MessageBoxResult.Yes)
                    {
                        ProgressWindow progressWindow = new ProgressWindow();
                        progressWindow.UninstallMode = true;
                        progressWindow.Show();
                    }
                    else
                    {
                        Application.Current.Shutdown(0);
                    }
                }
            }
            else if (passive)
            {
                CheckForVendorCustomizedEdkRepoAlreadyInstalled(passive);
                ProgressWindow progressWindow = new ProgressWindow();
                progressWindow.PassiveMode = true;
                progressWindow.Show();
            }
            else
            {
                CheckForVendorCustomizedEdkRepoAlreadyInstalled(passive);
                new MainWindow().Show();
            }
        }