예제 #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;
        }
예제 #2
0
 private void Form_Shown(object sender, EventArgs e)
 {
     try
     {
         GenericRegistryAccess.DeleteRegistryKey(RegistryBranch.HKLM_LOCAL_MACHINE__SOFTWARE_OxigenRef);
     }
     catch
     {
         // suppress all errors
     }
 }
예제 #3
0
        public MergeChannelsForm()
        {
            InitializeComponent();

            streams.CheckOnClick = true;
            string dataPath = (string)GenericRegistryAccess.GetRegistryValue("HKEY_LOCAL_MACHINE\\Software\\Oxigen", "DataSettingsPath") + "data\\";

            // subscriptions either downloaded from server or existing on user's machine with existing Oxigen II.
            // (that is, subscriptions not in Setup.ini)
            Setup.DuplicateLibrary.ChannelSubscriptions nonInstallerAccompanyingSubscriptions = null;

            if (AppDataSingleton.Instance.MergeStreamsInstallation)
            {
                string existingSubscriptionsPath = dataPath + "SettingsData\\ss_channel_subscription_data.dat";

                if (File.Exists(existingSubscriptionsPath))
                {
                    nonInstallerAccompanyingSubscriptions = (Setup.DuplicateLibrary.ChannelSubscriptions)Serializer.Deserialize(typeof(Setup.DuplicateLibrary.ChannelSubscriptions), existingSubscriptionsPath, "password");
                }
            }

            List <Setup.DuplicateLibrary.ChannelSubscription> channelSubscriptions = new List <Setup.DuplicateLibrary.ChannelSubscription>();

            foreach (Setup.DuplicateLibrary.ChannelSubscription subscription in AppDataSingleton.Instance.FileDetectedChannelSubscriptionsLocal.SubscriptionSet)
            {
                channelSubscriptions.Add(subscription);
            }

            // merge Subscriptions from existing user's ss_channel_subscription_data
            // with those from Setup.ini with subscription. For existing users only.
            if (AppDataSingleton.Instance.MergeStreamsInstallation)
            {
                if (nonInstallerAccompanyingSubscriptions != null && nonInstallerAccompanyingSubscriptions.SubscriptionSet != null)
                {
                    foreach (Setup.DuplicateLibrary.ChannelSubscription subscription in nonInstallerAccompanyingSubscriptions.SubscriptionSet)
                    {
                        if (!Contains(channelSubscriptions, subscription))
                        {
                            channelSubscriptions.Add(subscription);
                        }
                    }
                }
            }

            foreach (Setup.DuplicateLibrary.ChannelSubscription cs in channelSubscriptions)
            {
                streams.Items.Add(cs, true);
            }

            streams.DisplayMember = "ChannelName";
        }
예제 #4
0
        private void btnExit_Click(object sender, EventArgs e)
        {
            Process processCE = null;

            ProcessStartInfo startInfoCE = new ProcessStartInfo((string)GenericRegistryAccess.GetRegistryValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Oxigen", "ProgramPath") + "bin\\OxigenCE.exe", "/v");

            try
            {
                processCE = Process.Start(startInfoCE);
            }
            catch
            {
                // ignore
            }

            Application.Exit();
        }
예제 #5
0
        private UninstallOlderSoftwareStatus GetProductCode(ref string productCode, ref string installSource)
        {
            RegistryKey uninstallKey = GenericRegistryAccess.GetRegistryKey(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall");

            if (uninstallKey == null)
            {
                return(UninstallOlderSoftwareStatus.KeyNotFound);
            }

            List <string> productCodes = GetProductCodes();

            string[] subkeyNames = uninstallKey.GetSubKeyNames();

            foreach (string keyName in subkeyNames)
            {
                if (Contains(keyName, productCodes))
                {
                    _logger.WriteTimestampedMessage("Product code found: " + keyName);

                    productCode = keyName;

                    // get the install source as older Oxigen leaves stuff there when it's done uninstalling so
                    // we need to clean those too
                    RegistryKey productUninstallKey = GenericRegistryAccess.GetRegistryKey(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" + productCode);

                    object installSourceObj = productUninstallKey.GetValue("InstallSource");

                    if (installSourceObj != null)
                    {
                        installSource = (string)installSourceObj;
                    }

                    return(UninstallOlderSoftwareStatus.Success);
                }
            }

            if (productCode == null)
            {
                _logger.WriteTimestampedMessage("No product code found");
            }

            return(UninstallOlderSoftwareStatus.Success);
        }
예제 #6
0
        public static void SetScreenSaver(string ScreenSaverName)
        {
            string systemFolder = SetupHelper.GetSystemDirectory() + "\\";

            GenericRegistryAccess.SetRegistryValue(@"HKEY_CURRENT_USER\Control Panel\Desktop", "SCRNSAVE.EXE", systemFolder + ScreenSaverName + ".scr");
        }
예제 #7
0
        private UninstallOlderSoftwareStatus RemoveProduct(string productCode, string olderOxigenInstallSource)
        {
            string installPath = null;
            UninstallOlderSoftwareStatus status = RunSupportFiles();

            _logger.WriteTimestampedMessage("Have support files run? UninstallOlderSoftwareStatus: " + status.ToString());

            if (_backgroundWorker != null)
            {
                _backgroundWorker.ReportProgress(5);
            }

            if (status != UninstallOlderSoftwareStatus.Success)
            {
                return(status);
            }

            object installPathObj = GenericRegistryAccess.GetRegistryValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Oxigen", "path");

            if (installPathObj != null)
            {
                installPath = (string)installPathObj;
                _logger.WriteTimestampedMessage(@"HKEY_LOCAL_MACHINE\SOFTWARE\Oxigen\path = " + installPath);
            }
            else
            {
                _logger.WriteTimestampedMessage(@"HKEY_LOCAL_MACHINE\SOFTWARE\Oxigen\path not found");
            }

            status = UninstallMSI(productCode);

            _logger.WriteTimestampedMessage("UninstallMSI return status: " + status);

            if (_backgroundWorker != null)
            {
                _backgroundWorker.ReportProgress(80);
            }

            _bSystemModified = true;

            if (status != UninstallOlderSoftwareStatus.Success)
            {
                return(status);
            }

            // delete install directory
            if (installPathObj != null && Directory.Exists(installPath))
            {
                _logger.WriteTimestampedMessage("Deleting directory " + installPath);

                try
                {
                    if (Directory.Exists(installPath))
                    {
                        Directory.Delete(installPath, true);
                    }
                }
                catch (Exception ex)
                {
                    _logger.WriteTimestampedMessage(ex.ToString());

                    return(UninstallOlderSoftwareStatus.ErrorDeletingBinaries);
                }
            }

            // delete temp install directory that Older Oxigen normally leaves
            if (olderOxigenInstallSource != null && Directory.Exists(olderOxigenInstallSource))
            {
                try
                {
                    if (Directory.Exists(olderOxigenInstallSource))
                    {
                        Directory.Delete(olderOxigenInstallSource, true);
                    }
                }
                catch (Exception ex)
                {
                    _logger.WriteTimestampedMessage(ex.ToString());

                    return(UninstallOlderSoftwareStatus.ErrorDeletingTempInstallFiles);
                }
            }

            GenericRegistryAccess.DeleteRegistryValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Oxigen", "path");
            GenericRegistryAccess.DeleteRegistryValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Oxigen", "path");

            if (_backgroundWorker != null)
            {
                _backgroundWorker.ReportProgress(100);
            }

            return(UninstallOlderSoftwareStatus.Success);
        }