private static void CheckForKitUpdates()
        {
            try {
                KitsList           available = LatestAvailableKitsVersions();
                List <ImportedKit> installed = KitUtils.ListImportedKits(null)().FindAll(
                    k => KitUtils.IsKitInstalled(k.Name)
                    );

                foreach (ImportedKit kit in installed)
                {
                    KitsObject upgradeable = available.Find(
                        k => k.Name.Equals(kit.Name, System.StringComparison.OrdinalIgnoreCase) && new System.Version(k.Version) > kit.Instance.Version()
                        );

                    if (upgradeable == null)
                    {
                        continue;
                    }

                    Utils.Log(
                        "{0} kit version {1} is available! Please open the Fabric plugin to install the latest version.",
                        upgradeable.Name,
                        upgradeable.Version
                        );
                }
            } catch (System.Exception) {
                Utils.Log("Couldn't determine whether kit updates are available!");
            }
        }
Example #2
0
        private static HashSet <VersionedDependency> Collect(DependencyGraphObject current, string kit, ref HashSet <VersionedDependency> collected)
        {
            KitsObject kitObject = current.Dependencies.Kits.Find(
                k => k.Name.Equals(kit, System.StringComparison.OrdinalIgnoreCase)
                );

            if (kitObject == null)
            {
                return(collected);
            }

            return(CollectTransitiveDependencies(current, kitObject.DependsOn, ref collected));
        }
        public static bool IsPluginUpdateRequired(string name)
        {
            Dependency.DependencyGraphManager dg = updateChecker.GetDependencyGraphManager();
            if (dg == null)
            {
                return(false);
            }

            KitsObject found = dg.LatestAvailableKitVersions().Find(
                k => k.Name.Equals(name, System.StringComparison.OrdinalIgnoreCase)
                );

            return(found != null && new System.Version(found.MinimumPluginVersion) > Fabric.Internal.Editor.Info.Version);
        }
        public static bool IsKitUpdateAvailable(string name, System.Version installedVersion)
        {
            Dependency.DependencyGraphManager dg = updateChecker.GetDependencyGraphManager();
            if (dg == null)
            {
                return(false);
            }

            KitsObject found = dg.LatestAvailableKitVersions().Find(
                k => k.Name.Equals(name, System.StringComparison.OrdinalIgnoreCase)
                );

            return(found != null && new System.Version(found.Version) > installedVersion);
        }