上一篇:http://blog.csdn.net/yikalyosi/article/details/72790175
一些错误:
库中的CheckMd5State类里的doCheckResource函数的
if (isTargetLatest)
{
File.Replace(Application.persistentDataPath + "/" + res_md5_latest,
Application.persistentDataPath + "/" + res_md5, null);
File.Replace(Application.persistentDataPath + "/" + CheckVersionState.res_version_latest,
Application.persistentDataPath + "/" + CheckVersionState.res_version, null);
}
改为
if (isTargetLatest)
{
if (!File.Exists(Application.persistentDataPath + "/" + res_md5))
{
File.Move(Application.persistentDataPath + "/" + res_md5_latest,
Application.persistentDataPath + "/" + res_md5);
}
else
{
File.Replace(Application.persistentDataPath + "/" + res_md5_latest,
Application.persistentDataPath + "/" + res_md5, null);
}
if (!File.Exists(Application.persistentDataPath + "/" + CheckVersionState.res_version))
{
File.Move(Application.persistentDataPath + "/" + CheckVersionState.res_version_latest,
Application.persistentDataPath + "/" + CheckVersionState.res_version);
}
else
{
File.Replace(Application.persistentDataPath + "/" + CheckVersionState.res_version_latest,
Application.persistentDataPath + "/" + CheckVersionState.res_version, null);
}
}
Downloader.cs的StartDownload函数中:
webclient.DownloadFileAsync(new Uri(hosts[idx] + serveInfo.url), outputPath + serveInfo.fn, serveInfo.fn);
改为
webclient.DownloadFileAsync(new Uri(hosts[idx] + serveInfo.url), outputPath +"/"+ serveInfo.fn, serveInfo.fn);