public bool DownloadUpdate(string file, string hash)
{
try
{
var client = new WebClient();
var tempDir = new DirectoryInfo(UpdateConstants.UpdateFolder);
if (!tempDir.Exists)
{
tempDir.Create();
}
client.DownloadFile(UpdateConstants.UpdateUrl + "\\" + file, string.Format("{0}\\Package", tempDir));
client.Dispose();
return DTHasher.GetMD5Hash(string.Format("{0}\\Package\\", tempDir)) == hash;
}
catch
{
return false;
}
}