mirror of
https://github.com/ckaczor/Common.git
synced 2026-01-13 17:22:40 -05:00
Fix update download when using GitHub
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Threading.Tasks;
|
||||
@@ -55,13 +56,15 @@ namespace Common.Update
|
||||
if (RemoteVersion == null)
|
||||
return false;
|
||||
|
||||
var remoteFile = UpdateServer + RemoteVersion.InstallFile;
|
||||
var remoteFile = UpdateServerType == ServerType.GitHub ? RemoteVersion.InstallFile : UpdateServer + RemoteVersion.InstallFile;
|
||||
|
||||
LocalInstallFile = Path.Combine(Path.GetTempPath(), RemoteVersion.InstallFile);
|
||||
var remoteUri = new Uri(remoteFile);
|
||||
|
||||
LocalInstallFile = Path.Combine(Path.GetTempPath(), remoteUri.Segments.Last());
|
||||
|
||||
var webClient = new WebClient();
|
||||
|
||||
await webClient.DownloadFileTaskAsync(new Uri(remoteFile), LocalInstallFile);
|
||||
await webClient.DownloadFileTaskAsync(remoteUri, LocalInstallFile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user