public static void checkForModUpdate(PolyTechMod plugin)
        {
            if (plugin.repositoryUrl == null)
            {
                return;
            }
            var client = new WebClient();

            client.Headers.Add("User-Agent", "Nothing");

            // get latest release version
            string repoReleaseUri = "https://api.github.com/repos" + new Uri(plugin.repositoryUrl).AbsolutePath + "releases";
            string content;

            try
            {
                content = client.DownloadString(repoReleaseUri);
            }
            catch (Exception e)
            {
                ptfInstance.ptfLogger.LogError(e.Message);
                return;
            }

            // deserialize incoming JSON from repo api
            List <Release> releases = null;

            using (MemoryStream ms = new MemoryStream(Encoding.Unicode.GetBytes(content)))
            {
                DataContractJsonSerializer jsonSerializer = new DataContractJsonSerializer(typeof(List <Release>));
                releases = (List <Release>)jsonSerializer.ReadObject(ms);
            }
            if (releases == null)
            {
                return;
            }
            if (releases.Count <= 0)
            {
                return;
            }
            Release latestRelease = releases[0];

            if (latestRelease.GetVersion().CompareTo(plugin.Info.Metadata.Version) > 0)
            {
                ModUpdate modUpdate = new ModUpdate(plugin, latestRelease);
                if (patchGameStart.game_started)
                {
                    modUpdatePopup(modUpdate);
                }
                else
                {
                    patchGameStart.modUpdates.Add(modUpdate);
                }
            }
        }
 private static void modUpdatePopup(ModUpdate modUpdate)
 {
     ptfInstance.ptfLogger.LogInfo($"\n------------------------\n{modUpdate.mod.Info.Metadata.Name} has an update available!\n{modUpdate.old_version} -> {modUpdate.new_version}\n------------------------\n");
     PopUpMessage.Display($"{modUpdate.mod.Info.Metadata.Name} has an update available!\n{modUpdate.old_version} -> {modUpdate.new_version}", () => System.Diagnostics.Process.Start(modUpdate.latest_release.html_url));
 }