public static string Download(Release R, string FileName, bool Replace = true) { FileName = Path.Combine(ExeDir, FileName); if (File.Exists(FileName)) { if (Replace) File.Delete(FileName); else throw new Exception("File exists " + FileName); } WebClient WC = new WebClient(); WC.DownloadFile(R.assets[0].browser_download_url, FileName); return Path.GetFullPath(FileName); }
public static void UpdateTo(Release Rel) { CreateAndExecUpdateBatch(Unzip(Download(Rel, "__latest.zip"), "__latest"), "Upd.bat"); }