/// <summary> /// Fetches all the latest release info, populating our attributes in /// the process. /// </summary> public void FetchLatestReleaseInfo() { var response = MakeRequest(latestCKANReleaseApiUrl); try { fetchedCkanUrl = RetrieveUrl(response, 0); // Check whether the release includes the auto updater foreach (var asset in response.assets) { string url = asset.browser_download_url.ToString(); if (url.EndsWith("AutoUpdater.exe")) { fetchedUpdaterUrl = new Tuple <Uri, long>(new Uri(url), (long)asset.size); break; } } if (fetchedUpdaterUrl == null) { // Older releases don't include the auto updater fetchedUpdaterUrl = RetrieveUrl(MakeRequest(oldLatestUpdaterReleaseApiUrl), 0); } } catch (Kraken) { LatestVersion = new Version(Meta.GetVersion()); return; } ReleaseNotes = ExtractReleaseNotes(response.body.ToString()); LatestVersion = new CKANVersion(response.tag_name.ToString(), response.name.ToString()); }
/// <summary> /// Fetches all the latest release info, populating our attributes in /// the process. /// </summary> public void FetchLatestReleaseInfo() { var response = MakeRequest(latestCKANReleaseApiUrl); try { fetchedUpdaterUrl = RetrieveUrl(MakeRequest(latestUpdaterReleaseApiUrl)); fetchedCkanUrl = RetrieveUrl(response); } catch (Kraken) { LatestVersion = new Version(Meta.Version()); return; } string body = response.body.ToString(); ReleaseNotes = ExtractReleaseNotes(body); LatestVersion = new CKANVersion(response.tag_name.ToString(), response.name.ToString()); }