Exemple #1
0
        private void GetInstalledApplications()
        {
            var appNames = Registry_Functions.GetKeyNames();

            if (appNames != null)
            {
                foreach (var appName in appNames)
                {
                    var valueNames = Registry_Functions.GetValueNames(appName);

                    var item = new UpdateItem();
                    item.ApplyClicked           += Apply;
                    item.CheckForUpdatesClicked += Check;

                    item.ApplicationName     = appName;
                    item.ApplicationTitle    = GetValueData(valueNames.ToList().Find(x => x == "title"), appName);
                    item.ApplicationSubtitle = GetValueData(valueNames.ToList().Find(x => x == "subtitle"), appName);

                    string lastUpdated   = GetValueData(valueNames.ToList().Find(x => x == "update_last_checked"), appName);
                    string lastInstalled = GetValueData(valueNames.ToList().Find(x => x == "update_last_installed"), appName);

                    if (!String.IsNullOrEmpty(lastUpdated))
                    {
                        item.UpdateLastChecked = lastUpdated;
                    }
                    if (!String.IsNullOrEmpty(lastInstalled))
                    {
                        item.UpdateLastInstalled = lastInstalled;
                    }

                    CheckForDownloadedUpdates(item);

                    // Make sure that TrakHound Client/Bundle is first
                    if (appName == ApplicationNames.TRAKHOUND_BUNDLE)
                    {
                        UpdateItems.Insert(0, item);
                    }
                    else
                    {
                        UpdateItems.Add(item);
                    }
                }
            }
        }
Exemple #2
0
        private void CheckForDownloadedUpdates(UpdateItem item)
        {
            string appName = item.ApplicationName;

            var valueNames = Registry_Functions.GetValueNames(appName);

            if (valueNames != null)
            {
                var updatePath = valueNames.ToList().Exists(x => x == "update_path");
                if (updatePath)
                {
                    string version = GetValueData(valueNames.ToList().Find(x => x == "update_version"), appName);

                    item.Loading         = false;
                    item.UpdateAvailable = true;
                    item.Status          = version + " Update Ready";
                }
            }
        }
Exemple #3
0
        private void CheckTimestamps(UpdateItem item)
        {
            string appName = item.ApplicationName;

            var valueNames = Registry_Functions.GetValueNames(appName);

            if (valueNames != null)
            {
                string lastUpdated   = GetValueData(valueNames.ToList().Find(x => x == "update_last_checked"), appName);
                string lastInstalled = GetValueData(valueNames.ToList().Find(x => x == "update_last_installed"), appName);

                if (!String.IsNullOrEmpty(lastUpdated))
                {
                    item.UpdateLastChecked = lastUpdated;
                }
                if (!String.IsNullOrEmpty(lastInstalled))
                {
                    item.UpdateLastInstalled = lastInstalled;
                }
            }
        }
Exemple #4
0
 private static string GetValueData(string valueName, string appName)
 {
     return(Registry_Functions.GetValue(valueName, appName));
 }