mirror of
https://github.com/ckaczor/Common.git
synced 2026-02-17 02:51:47 -05:00
Fix update download when using GitHub
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
@@ -55,13 +56,15 @@ namespace Common.Update
|
|||||||
if (RemoteVersion == null)
|
if (RemoteVersion == null)
|
||||||
return false;
|
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();
|
var webClient = new WebClient();
|
||||||
|
|
||||||
await webClient.DownloadFileTaskAsync(new Uri(remoteFile), LocalInstallFile);
|
await webClient.DownloadFileTaskAsync(remoteUri, LocalInstallFile);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user