Example #1
0
        private void buttonApply_Click(object sender, EventArgs e)
        {
            XML_Save(currentFile);
            MenuControl.Menu98_ExitHost();
            MenuControl.Menu98_Inject(textBoxClassName.Text);

            if (Installer.ExplorerImmersiveMenuRemoved() != checkBoxNoExplorerImmersiveMenu.Checked)
            {
                Installer.ExplorerImmersiveMenuUsing(!checkBoxNoExplorerImmersiveMenu.Checked);
            }
        }
Example #2
0
 private void buttonReleadDLL_Click(object sender, EventArgs e)
 {
     MenuControl.Menu98_ExitHost();
     buttonDetect_Click(sender, e);
 }
Example #3
0
        public static void LaunchUninstall(Form Parent)
        {
            bool deleteConfig = false;

            if (WinVer.IsVistaOrGreater())
            {
                TaskDialog dlg = new TaskDialog();
                dlg.Icon            = Properties.Resources.Installer.Handle;
                dlg.WindowTitle     = "Uninstall";
                dlg.MainInstruction = "Uninstall this software from your system";
                dlg.Content         = "This program will not be deleted.";
                dlg.AddButton((int)DialogResult.Yes, "Uninstall now").ShowShield = true;
                dlg.CommonButtons   = TASKDIALOG_COMMON_BUTTON_FLAGS.TDCBF_CANCEL_BUTTON;
                dlg.UseCommandLinks = true;
                dlg.CheckBoxText    = "Delete configuration file";
                if (dlg.ShowDialog(Parent.Handle) == (int)DialogResult.Yes)
                {
                    deleteConfig = dlg.CheckBoxChecked;
                }
                else
                {
                    return;
                }
            }
            else
            {
                switch (MessageBox.Show(Parent, "Uninstall this software from your system.\nYes - Uninstall without deleting config file\nNo - Uninstall and delete the config file", "Uninstall", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question))
                {
                case DialogResult.Yes:
                    deleteConfig = false;
                    break;

                case DialogResult.No:
                    deleteConfig = true;
                    break;

                case DialogResult.Cancel:
                    return;
                }
            }

            if (MenuControl.isMenu98ModuleLoaded())
            {
                MenuControl.Menu98_ExitHost();
            }

            try
            {
                UninstallFromSystem(deleteConfig);
            }
            catch (UnauthorizedAccessException)
            {
                UninstallWithPrivilage(deleteConfig);
            }
            catch (System.Security.SecurityException)
            {
                UninstallWithPrivilage(deleteConfig);
            }

            MessageBox.Show(Parent, "Uninstalled successfully", "Uninstall", MessageBoxButtons.OK, MessageBoxIcon.Information);
            Application.Exit();
        }