private static void ProcessUpdate() { Console.WriteLine("Fetching update info..."); UpdateFile update = new UpdateFile(); update.ReadXmlFromInterweb("http://www.xobanimot.com/snakebite/update/update.xml"); var SBVersion = GetSBVersion(); var UpdaterVersion = GetUpdaterVersion(); if (update.Updater.Version.AsVersion() > UpdaterVersion) { Console.WriteLine(String.Format("Updating SBUpdater to version {0}...", update.Updater.Version.AsString())); // Process updating the updater DownloadAndUpdateUpdater(update.Updater.URL); } else { Console.WriteLine("SBUpdater is up to date."); } if (update.SnakeBite.Version.AsVersion() > SBVersion) { Console.WriteLine(String.Format("Updating SnakeBite to version {0}...", update.SnakeBite.Version.AsString())); // Process updating SnakeBite DownloadAndUpdateSnakeBite(update.SnakeBite.URL); } else { Console.WriteLine("SnakeBite is up to date."); } Process.Start("SnakeBite.exe"); }
private void formLauncher_Load(object sender, EventArgs e) { textInfo = cultureInfo.TextInfo; // Check for updates Debug.LogLine("[Update] Checking for updates"); UpdateFile updater = new UpdateFile(); bool updateSuccess = updater.ReadXmlFromInterweb("http://www.xobanimot.com/snakebite/update/update.xml"); if (updateSuccess) { if (updater.SnakeBite.Version.AsVersion() > ModManager.GetSBVersion()) { Debug.LogLine(String.Format("Update found! Version {0} is available", updater.SnakeBite.Version.AsVersion())); labelUpdate.Text = String.Format("SnakeBite version {0} now available!", updater.SnakeBite.Version.AsString()); labelUpdate.Show(); } else { Debug.LogLine("No update found"); } } // Retrieve and display version info var MGSVersionInfo = FileVersionInfo.GetVersionInfo(Properties.Settings.Default.InstallPath + "\\mgsvtpp.exe"); string SBVersion = Application.ProductVersion; string MGSVersion = MGSVersionInfo.ProductVersion; // Update version text string VersionText = String.Format("MGSV {0} / SB {1}", MGSVersion, SBVersion); labelVersion.Text = VersionText; UpdateVersionLabel(); UpdateModToggle(); SetupTheme(); // Fade in form Opacity = 0; int duration = 100;//in milliseconds int steps = 30; Timer timer = new Timer(); timer.Interval = duration / steps; int currentStep = 0; timer.Tick += (arg1, arg2) => { Opacity = ((double)currentStep) / steps; currentStep++; if (Opacity == 1) { timer.Stop(); timer.Dispose(); } }; timer.Start(); }