diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2020-03-12 16:22:04 +1100 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2020-03-12 16:23:54 +1100 |
commit | 6ce359752afac0d3d70c2cf5fabd7d92859564ee (patch) | |
tree | 2c5bd798b6f6942a27031002015a5720032e7840 /src/engine/core.cpp | |
parent | 91cc7ff5c0f387d39c5999032b4472cbb00e1cd6 (diff) | |
download | wix-6ce359752afac0d3d70c2cf5fabd7d92859564ee.tar.gz wix-6ce359752afac0d3d70c2cf5fabd7d92859564ee.tar.bz2 wix-6ce359752afac0d3d70c2cf5fabd7d92859564ee.zip |
Retry ElevationElevate once if we think it failed due to antivirus interference.
Diffstat (limited to 'src/engine/core.cpp')
-rw-r--r-- | src/engine/core.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/engine/core.cpp b/src/engine/core.cpp index 519012e9..10750be8 100644 --- a/src/engine/core.cpp +++ b/src/engine/core.cpp | |||
@@ -508,10 +508,11 @@ extern "C" HRESULT CoreElevate( | |||
508 | ) | 508 | ) |
509 | { | 509 | { |
510 | HRESULT hr = S_OK; | 510 | HRESULT hr = S_OK; |
511 | DWORD cAVRetryAttempts = 0; | ||
511 | 512 | ||
512 | // If the elevated companion pipe isn't created yet, let's make that happen. | 513 | while (INVALID_HANDLE_VALUE == pEngineState->companionConnection.hPipe) |
513 | if (INVALID_HANDLE_VALUE == pEngineState->companionConnection.hPipe) | ||
514 | { | 514 | { |
515 | // If the elevated companion pipe isn't created yet, let's make that happen. | ||
515 | if (!pEngineState->sczBundleEngineWorkingPath) | 516 | if (!pEngineState->sczBundleEngineWorkingPath) |
516 | { | 517 | { |
517 | hr = CacheBundleToWorkingDirectory(pEngineState->registration.sczId, pEngineState->registration.sczExecutableName, &pEngineState->userExperience.payloads, &pEngineState->section, &pEngineState->sczBundleEngineWorkingPath); | 518 | hr = CacheBundleToWorkingDirectory(pEngineState->registration.sczId, pEngineState->registration.sczExecutableName, &pEngineState->userExperience.payloads, &pEngineState->section, &pEngineState->sczBundleEngineWorkingPath); |
@@ -519,6 +520,11 @@ extern "C" HRESULT CoreElevate( | |||
519 | } | 520 | } |
520 | 521 | ||
521 | hr = ElevationElevate(pEngineState, hwndParent); | 522 | hr = ElevationElevate(pEngineState, hwndParent); |
523 | if (E_SUSPECTED_AV_INTERFERENCE == hr && 1 > cAVRetryAttempts) | ||
524 | { | ||
525 | ++cAVRetryAttempts; | ||
526 | continue; | ||
527 | } | ||
522 | ExitOnFailure(hr, "Failed to actually elevate."); | 528 | ExitOnFailure(hr, "Failed to actually elevate."); |
523 | 529 | ||
524 | hr = VariableSetNumeric(&pEngineState->variables, BURN_BUNDLE_ELEVATED, TRUE, TRUE); | 530 | hr = VariableSetNumeric(&pEngineState->variables, BURN_BUNDLE_ELEVATED, TRUE, TRUE); |