Beispiel #1
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";
        }
Beispiel #2
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();
        }
Beispiel #3
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);
        }