예제 #1
0
 void checkversion()
 {
     if (Setout.GetServerVersion() > new Version(Application.ProductVersion))
     {
         startDownload();
     }
     else
     {
         MessageBox.Show("Your client is up-to-date.");
         Hide();
     }
 }
예제 #2
0
        public static void CheckForNewBotVersion()
        {
            try
            {
                var newest = Setout.GetServerVersion();

                if (newest <= Assembly.GetExecutingAssembly().GetName().Version)
                {
                    //ColoredConsoleWrite(ConsoleColor.Yellow, "Awesome! You have already got the newest version! " + Assembly.GetExecutingAssembly().GetName().Version);
                    return;
                }

                Logger.ColoredConsoleWrite(ConsoleColor.Red, $"Bot Version {newest} is available!");
                Logger.ColoredConsoleWrite(ConsoleColor.Red, "We recommend to use this new version.");
            }
            catch (Exception)
            {
                Logger.ColoredConsoleWrite(ConsoleColor.White, "Unable to check for updates now...");
            }
        }