I had/have same problem....
//
CheckFiles of Launcher:
private void btn_check_Click(object sender, RoutedEventArgs e)
{
}
does anyone know the code line of CheckFiles compare and download?
I have created this, but it is not fully apt to interface
he check hashs = files of launcher/client.
launcher close and download files of hash is correct
Code:
private void btn_check_Click(object sender, RoutedEventArgs e)
{
int i = 1;
downloadable_files.Clear();
foreach (var items in mgr_cfg.ConfigRemote.Hashes.Hash)
{
if (items.hash != App.GetMd5HashFromFile(items.file))
{
downloadable_files.Add(i, items.file);
Console.WriteLine("Index: {0} File: {1}", i, items.file);
ViewModel.FileDownloader.SetSource(client_hostname + "client/" + items.file);
ViewModel.FileDownloader.SetTarget(items.file);
ViewModel.FileDownloader.Download();
ViewModel.ReportStatus.Report("Update completed.");
while (ViewModel.FileDownloader.IsRunning())
{
Thread.Sleep(50);
Process.GetCurrentProcess().Kill();
}
}
ViewModel.ReportProgess.Progess(i, mgr_cfg.ConfigRemote.Hashes.count);
ViewModel.ReportStatus.Report("Checking Files " + i + " de " +
mgr_cfg.ConfigRemote.Hashes.count);
i++;
ViewModel.ReportStatus.Report("Already for play...");
if (i == mgr_cfg.ConfigRemote.Hashes.count)
{
uptodate = false;
}
else
{
if (App.GetMd5HashFromFile(client_cabalmain) !=
mgr_cfg.ConfigRemote.Settings.CabalMainHash)
{
ViewModel.FileDownloader.SetSource(client_hostname + "client/" + client_cabalmain);
ViewModel.FileDownloader.SetTarget(client_cabalmain);
ViewModel.FileDownloader.Download();
ViewModel.ReportStatus.Report("Update completed.");
while (ViewModel.FileDownloader.IsRunning())
{
Thread.Sleep(50);
}
ViewModel.ReportStatus.Report("Update completed.");
uptodate = true;
Process.GetCurrentProcess().Kill();
}
else
{
uptodate = true;
}
}
}