|
|
|
@ -331,8 +331,10 @@ void plSelfPatcher::IEnqueueFile(const NetCliFileManifestEntry& file)
|
|
|
|
|
wk->fType = kHash; |
|
|
|
|
memcpy(&wk->fEntry, &file, sizeof(NetCliFileManifestEntry)); |
|
|
|
|
|
|
|
|
|
// Kludge: any EXE we have here that isn't the launcher is clearly an installer.
|
|
|
|
|
if (StrCmpI(file.clientName, kPatcherExeFilename) != 0) { |
|
|
|
|
// Are we the patcher? If not, any other exe or msi should be installed.
|
|
|
|
|
if (IsPatcherFile(wk->fEntry.clientName)) { |
|
|
|
|
wk->fFlags |= kRequestNewPatcher; |
|
|
|
|
} else { |
|
|
|
|
const wchar* extension = PathFindExtension(file.clientName); |
|
|
|
|
if (extension && (StrCmpI(extension, L".exe") == 0 || StrCmpI(extension, L".msi") == 0)) |
|
|
|
|
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); |
|
|
|
|
SelfPatcherStream::totalBytes += (wk->fEntry.zipSize != 0) ? wk->fEntry.zipSize : wk->fEntry.fileSize; |
|
|
|
|
wk->fType = kDownload; |
|
|
|
|
IEnqueueWork(wk, isPatcher); |
|
|
|
|
IEnqueueWork(wk); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//============================================================================
|
|
|
|
@ -485,11 +481,6 @@ void plSelfPatcher::IVerifyFile(PatcherWork*& wk)
|
|
|
|
|
|
|
|
|
|
wk->fType = kInstall; |
|
|
|
|
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 { |
|
|
|
|
LogMsg(kLogPerf, L"plSelfPatcher::IVerifyFile: Downloaded valid standard file '%s'", wk->fEntry.clientName); |
|
|
|
|
s_selfPatcher.IDequeueWork(wk); |
|
|
|
@ -880,7 +871,7 @@ void plSelfPatcher::OnFileSrvDownload(ENetError result, void* param,
|
|
|
|
|
} else { |
|
|
|
|
PatcherWork* wk = (PatcherWork*)param; |
|
|
|
|
wk->fType = kVerify; |
|
|
|
|
s_selfPatcher.IEnqueueWork(wk, (wk->fFlags & kRequestNewPatcher)); |
|
|
|
|
s_selfPatcher.IEnqueueWork(wk); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|