示例#1
0
        public void ShowVersion()
        {
            var versionInformation = Evergreen.GetCurrentAddInVersion();

            var version = new Notification {
                Message  = versionInformation.ToString(),
                ImageUrl = "",
                Title    = "Evergreen"
            };

            FrameworkApplication.AddNotification(version);
        }
示例#2
0
 /// <summary>
 /// Called when the addin initializes to check for updates and download the latest
 /// </summary>
 /// <returns>Task</returns>
 public static Task RunAsyncUpdateCheck()
 {
     return(QueuedTask.Run(async() => {
         // check current release and update it if there's a newer version
         var evergreen = new Evergreen("roemhildtg", "arcgis-pro-addins");
         VersionInformation currentVersion = evergreen.GetCurrentAddInVersion();
         Release latestVersion = await evergreen.GetLatestReleaseFromGithub();
         if (!evergreen.IsCurrent(currentVersion.AddInVersion, latestVersion))
         {
             await evergreen.Update(latestVersion);
             var notify = new ArcGIS.Desktop.Framework.Notification();
             notify.Title = "Addin Update";
             notify.Message = string.Format("Your pro-addins have been updated to version {0}. Please restart Pro to complete the update.", latestVersion.TagName);
             FrameworkApplication.AddNotification(notify);
         }
     }));
 }
示例#3
0
        private static void Main()
        {
            var updator = new Evergreen("steveoh", "pro-evergreen");
            var release = updator.GetLatestReleaseFromGithub().Result;

            var version = updator.GetCurrentAddInVersion();

            if (updator.IsCurrent(version.AddInVersion, release))
            {
                return;
            }

            var assets = updator.Update(release).Result;

//            if (!updator.IsCompatible("currentProVersion", ".proversion from assets in release")) {
//                throw new Exception("incompatible versions of pro");
//            }
//
//            updator.Update(assets);
        }
示例#4
0
        public async Task CheckForUpdate()
        {
            Release = await Evergreen.GetLatestReleaseFromGithub();

            var version = Evergreen.GetCurrentAddInVersion();

            var notification = new Notification {
                Message  = "You are up to date.",
                ImageUrl = "",
                Title    = "Evergreen: Version Check"
            };

            if (Evergreen.IsCurrent(version.AddInVersion, Release))
            {
                FrameworkApplication.AddNotification(notification);

                return;
            }

            notification.Message = $"Release version {Release.TagName} is available";

            FrameworkApplication.AddNotification(notification);
        }