|
|
@ -331,8 +331,10 @@ void plSelfPatcher::IEnqueueFile(const NetCliFileManifestEntry& file) |
|
|
|
wk->fType = kHash; |
|
|
|
wk->fType = kHash; |
|
|
|
memcpy(&wk->fEntry, &file, sizeof(NetCliFileManifestEntry)); |
|
|
|
memcpy(&wk->fEntry, &file, sizeof(NetCliFileManifestEntry)); |
|
|
|
|
|
|
|
|
|
|
|
// Kludge: any EXE we have here that isn't the launcher is clearly an installer.
|
|
|
|
// Are we the patcher? If not, any other exe or msi should be installed.
|
|
|
|
if (StrCmpI(file.clientName, kPatcherExeFilename) != 0) { |
|
|
|
if (IsPatcherFile(wk->fEntry.clientName)) { |
|
|
|
|
|
|
|
wk->fFlags |= kRequestNewPatcher; |
|
|
|
|
|
|
|
} else { |
|
|
|
const wchar* extension = PathFindExtension(file.clientName); |
|
|
|
const wchar* extension = PathFindExtension(file.clientName); |
|
|
|
if (extension && (StrCmpI(extension, L".exe") == 0 || StrCmpI(extension, L".msi") == 0)) |
|
|
|
if (extension && (StrCmpI(extension, L".exe") == 0 || StrCmpI(extension, L".msi") == 0)) |
|
|
|
wk->fEntry.flags |= PATCHER_FLAG_INSTALLER; |
|
|
|
wk->fEntry.flags |= PATCHER_FLAG_INSTALLER; |
|
|
@ -427,16 +429,10 @@ void plSelfPatcher::ICheckAndRequest(PatcherWork*& wk) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// New patchers need to be downloaded FIRST, and we want to re-run the entire thing before
|
|
|
|
|
|
|
|
// continuing with the process.
|
|
|
|
|
|
|
|
bool isPatcher = IsPatcherFile(wk->fEntry.clientName); |
|
|
|
|
|
|
|
if (isPatcher) |
|
|
|
|
|
|
|
wk->fFlags |= kRequestNewPatcher; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LogMsg(kLogDebug, L"plSelfPatcher::ICheckAndRequest: File '%s' needs to be downloaded.", wk->fEntry.clientName); |
|
|
|
LogMsg(kLogDebug, L"plSelfPatcher::ICheckAndRequest: File '%s' needs to be downloaded.", wk->fEntry.clientName); |
|
|
|
SelfPatcherStream::totalBytes += (wk->fEntry.zipSize != 0) ? wk->fEntry.zipSize : wk->fEntry.fileSize; |
|
|
|
SelfPatcherStream::totalBytes += (wk->fEntry.zipSize != 0) ? wk->fEntry.zipSize : wk->fEntry.fileSize; |
|
|
|
wk->fType = kDownload; |
|
|
|
wk->fType = kDownload; |
|
|
|
IEnqueueWork(wk, isPatcher); |
|
|
|
IEnqueueWork(wk); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
//============================================================================
|
|
|
@ -485,11 +481,6 @@ void plSelfPatcher::IVerifyFile(PatcherWork*& wk) |
|
|
|
|
|
|
|
|
|
|
|
wk->fType = kInstall; |
|
|
|
wk->fType = kInstall; |
|
|
|
s_selfPatcher.IEnqueueWork(wk); |
|
|
|
s_selfPatcher.IEnqueueWork(wk); |
|
|
|
} else if (wk->fFlags & kRequestNewPatcher) { |
|
|
|
|
|
|
|
LogMsg(kLogPerf, L"plSelfPatcher::IVerifyFile: Downloaded a new patcher! '%s'", wk->fEntry.clientName); |
|
|
|
|
|
|
|
// Need to restart here w/new patcher.
|
|
|
|
|
|
|
|
fResult = kNetSuccess; |
|
|
|
|
|
|
|
IQuit(); |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
LogMsg(kLogPerf, L"plSelfPatcher::IVerifyFile: Downloaded valid standard file '%s'", wk->fEntry.clientName); |
|
|
|
LogMsg(kLogPerf, L"plSelfPatcher::IVerifyFile: Downloaded valid standard file '%s'", wk->fEntry.clientName); |
|
|
|
s_selfPatcher.IDequeueWork(wk); |
|
|
|
s_selfPatcher.IDequeueWork(wk); |
|
|
@ -880,7 +871,7 @@ void plSelfPatcher::OnFileSrvDownload(ENetError result, void* param, |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
PatcherWork* wk = (PatcherWork*)param; |
|
|
|
PatcherWork* wk = (PatcherWork*)param; |
|
|
|
wk->fType = kVerify; |
|
|
|
wk->fType = kVerify; |
|
|
|
s_selfPatcher.IEnqueueWork(wk, (wk->fFlags & kRequestNewPatcher)); |
|
|
|
s_selfPatcher.IEnqueueWork(wk); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|