Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using UpdaterDotNet;
- using System.IO;
- namespace UpdaterTest
- {
- class Program
- {
- static void Main(string[] args)
- {
- if (!File.Exists("Version.txt"))
- {
- Console.WriteLine("Version.txt not found.");
- return;
- }
- uint buildNumber = uint.Parse(File.ReadAllText("Version.txt"));
- string buildsUrl = "http://yoururl.com/Patches/PatchInfo.xml";
- Console.WriteLine("Updater Started! Checking for updates...");
- UpdateManager updater = new UpdateManager();
- if (updater.CheckForUpdates(buildsUrl, buildNumber))
- {
- if (updater.ShowUpdateNotice())
- {
- if (!updater.DownloadUpdate())
- {
- Console.WriteLine("Error downloading update");
- return;
- }
- if (!updater.InstallUpdate(null))
- {
- Console.WriteLine("Error running installer");
- return;
- }
- }
- }
- updater.Dispose();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement