Beispiel #1
0
        private void InstallationComplete_Shown(object sender, EventArgs e)
        {
            ClientLogger logger = new PersistentClientLogger();

            logger.Log("9-InstallationComplete");

            SendMissingOptionalRequirements(logger);

            ScreenSaver.SetScreenSaverActive(0);

            if (!AppDataSingleton.Instance.Repair)
            {
                // provoke LE, SU
                Process processLE = null;

                ProcessStartInfo startInfoLE = new ProcessStartInfo(AppDataSingleton.Instance.BinariesPath + "\\bin\\OxigenLE.exe", "/n");

                try
                {
                    processLE = Process.Start(startInfoLE);
                }
                catch
                {
                    // ignore
                }

                Process processSU = null;

                ProcessStartInfo startInfoSU = new ProcessStartInfo(AppDataSingleton.Instance.BinariesPath + "\\bin\\OxigenSU.exe", "/n");

                try
                {
                    processSU = Process.Start(startInfoSU);
                }
                catch
                {
                    // suppress all errors
                }

                processLE.WaitForExit();
                processSU.WaitForExit();
            }

            try
            {
                GenericRegistryAccess.DeleteRegistryKey(RegistryBranch.HKLM_LOCAL_MACHINE__SOFTWARE_OxigenRef);
            }
            catch
            {
                // suppress all errors
            }

            ScreenSaver.SetScreenSaver("Oxigen");
            ScreenSaver.SetScreenSaverActive(1);
            ScreenSaver.SetScreenSaverTimeout(180);

            btnExit.Enabled = true;
        }
        private void UninstallProgressForm_Shown(object sender, EventArgs e)
        {
            string userGUID         = null;
            string machineGUID      = null;
            string binaryPath       = null;
            string dataSettingsPath = null;

            Application.DoEvents();

            if (!SetupHelper.GetValuesFromRegistry(ref userGUID, ref machineGUID, ref dataSettingsPath, ref binaryPath))
            {
                MessageBox.Show("Cannot proceed with installation. Registry entries are corrupted.\r\nPlease run the installer again in repair mode.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                Application.Exit();
                return;
            }

            progressBar.Value = 3;

            Setup.UserManagementServicesLive.SimpleErrorWrapper wrapper = SetupHelper.SendUninstallInfo(userGUID, machineGUID);

            if (wrapper.ErrorStatus != Setup.UserManagementServicesLive.ErrorStatus1.Success)
            {
                if (wrapper.ErrorCode == "CONN")
                {
                    MessageBox.Show("Oxigen needs an active internet connection to uninstall. Please ensure that you are connected to the Internet.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    MessageBox.Show(wrapper.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }

                Application.Exit();
                return;
            }

            progressBar.Value = 10;

            ScreenSaver.SetScreenSaverActive(0);
            SetupHelper.KillApplications();

            progressBar.Value = 70;

            SetupHelper.ShowMessage(lblProgress, "Removing binaries...");

            SetupHelper.UninstallMSI(this);

            progressBar.Value = 90;

            SetupHelper.ShowMessage(lblProgress, "Cleaning up...");

            SetupHelper.RemoveAllFiles(binaryPath + "bin", SetupHelper.GetSystemDirectory(), dataSettingsPath);

            progressBar.Value = 100;

            SetupHelper.OpenForm <UninstallComplete>(this);
        }
Beispiel #3
0
        internal static void Uninstall()
        {
            string userGUID         = null;
            string machineGUID      = null;
            string dataSettingsPath = null;
            string binaryPath       = null;

            if (!SetupHelper.GetValuesFromRegistry(ref userGUID, ref machineGUID, ref dataSettingsPath, ref binaryPath))
            {
                return;
            }

            SimpleErrorWrapper wrapper = SetupHelper.SendUninstallInfo(userGUID, machineGUID);

            if (wrapper.ErrorStatus != Setup.UserManagementServicesLive.ErrorStatus1.Success)
            {
                return;
            }

            ScreenSaver.SetScreenSaverActive(0);
            SetupHelper.KillApplications();
            UninstallMSI();
            SetupHelper.RemoveAllFiles(binaryPath + "bin", SetupHelper.GetSystemDirectory(), dataSettingsPath);
        }
Beispiel #4
0
 private static void SetScreensaver()
 {
     ScreenSaver.SetScreenSaver("Oxigen");
     ScreenSaver.SetScreenSaverActive(1);
     ScreenSaver.SetScreenSaverTimeout(180);
 }