Add hash check to updater

This commit is contained in:
Natsumi
2023-06-18 10:03:05 +12:00
parent 21e8b30380
commit cc3f6f7ecd
4 changed files with 89 additions and 35 deletions
-14
View File
@@ -428,20 +428,6 @@ namespace VRCX
broadcastSocket.SendTo(byteBuffer, endPoint);
}
/// <summary>
/// Downloads the VRCX update executable from the specified URL and saves it to the AppData directory.
/// </summary>
/// <param name="url">The URL of the VRCX update to download.</param>
public void DownloadVRCXUpdate(string url)
{
var Location = Path.Combine(Program.AppDataDirectory, "update.exe");
using (var client = new WebClient())
{
client.Headers.Add("user-agent", Program.Version);
client.DownloadFile(new Uri(url), Location);
}
}
/// <summary>
/// Restarts the VRCX application for an update by launching a new process with the "/Upgrade" argument and exiting the current process.
/// </summary>