Battlelogium.Installer.InstallerCommon.GetDownload C# (CSharp) Method

GetDownload() public static method

public static GetDownload ( string dependency ) : Task
dependency string
return Task
        public static async Task<string> GetDownload(string dependency)
        {
            string url = await new WebClient().DownloadStringTaskAsync("http://battlelogium.github.io/Battlelogium/releaseinfo/download/" + dependency);
            return url;
        }

Usage Example

Example #1
0
        public async Task InstallDependency(string downloadKey, string labelName)
        {
            string originDownloadUrl = await InstallerCommon.GetDownload(downloadKey);

            this.SetStatusLabelSync("Downloading " + labelName + ". Please wait...");
            await downloader.DownloadFileTaskAsync(originDownloadUrl, Path.Combine(this.tempPath, downloadKey + "_inst.exe"));

            this.SetStatusLabelSync("Installing " + labelName + ". Please wait...");
            await Task.Run(() => {
                try
                {
                    Process.Start(Path.Combine(this.tempPath, downloadKey + "_inst.exe"), "/s").WaitForExit();
                }
                catch
                {
                    return;
                }
            });
        }
All Usage Examples Of Battlelogium.Installer.InstallerCommon::GetDownload