diff options
| author | Rob Mensching <rob@firegiant.com> | 2026-01-02 16:12:01 -0800 |
|---|---|---|
| committer | Rob Mensching <rob@firegiant.com> | 2026-01-02 16:12:01 -0800 |
| commit | b1b90775c9d715ae4193e3faaa419cf163a49bd5 (patch) | |
| tree | 3afc06dc51d0452b053ea4b57312fa354323fd5a | |
| parent | bd1110871eacff77d2de804c627a7851e95f1ebc (diff) | |
| download | wix-robmen/9104-base-uninstalls-patch.tar.gz wix-robmen/9104-base-uninstalls-patch.tar.bz2 wix-robmen/9104-base-uninstalls-patch.zip | |
Random fixesrobmen/9104-base-uninstalls-patch
| -rw-r--r-- | src/burn/engine/bootstrapperapplication.cpp | 2 | ||||
| -rw-r--r-- | src/burn/engine/burnpipe.cpp | 6 | ||||
| -rw-r--r-- | src/burn/engine/cabextract.cpp | 8 | ||||
| -rw-r--r-- | src/burn/engine/cache.cpp | 8 | ||||
| -rw-r--r-- | src/burn/engine/core.cpp | 7 | ||||
| -rw-r--r-- | src/burn/engine/dependency.cpp | 4 | ||||
| -rw-r--r-- | src/burn/engine/elevation.cpp | 10 | ||||
| -rw-r--r-- | src/burn/engine/exeengine.cpp | 2 | ||||
| -rw-r--r-- | src/burn/engine/logging.cpp | 7 | ||||
| -rw-r--r-- | src/burn/engine/msiengine.cpp | 12 | ||||
| -rw-r--r-- | src/burn/engine/msuengine.cpp | 2 | ||||
| -rw-r--r-- | src/burn/engine/plan.cpp | 9 | ||||
| -rw-r--r-- | src/burn/engine/pseudobundle.cpp | 11 | ||||
| -rw-r--r-- | src/burn/engine/search.cpp | 2 | ||||
| -rw-r--r-- | src/burn/engine/variant.cpp | 45 |
15 files changed, 80 insertions, 55 deletions
diff --git a/src/burn/engine/bootstrapperapplication.cpp b/src/burn/engine/bootstrapperapplication.cpp index dc3bd5da..346c47a5 100644 --- a/src/burn/engine/bootstrapperapplication.cpp +++ b/src/burn/engine/bootstrapperapplication.cpp | |||
| @@ -674,7 +674,7 @@ static HRESULT VerifyPipeSecret( | |||
| 674 | hr = StrAlloc(&sczVerificationSecret, cbVerificationSecret / sizeof(WCHAR) + 1); | 674 | hr = StrAlloc(&sczVerificationSecret, cbVerificationSecret / sizeof(WCHAR) + 1); |
| 675 | ExitOnFailure(hr, "Failed to allocate buffer for bootstrapper application verification secret."); | 675 | ExitOnFailure(hr, "Failed to allocate buffer for bootstrapper application verification secret."); |
| 676 | 676 | ||
| 677 | FileReadHandle(hPipe, reinterpret_cast<LPBYTE>(sczVerificationSecret), cbVerificationSecret); | 677 | hr = FileReadHandle(hPipe, reinterpret_cast<LPBYTE>(sczVerificationSecret), cbVerificationSecret); |
| 678 | ExitOnFailure(hr, "Failed to read verification secret from bootstrapper application pipe."); | 678 | ExitOnFailure(hr, "Failed to read verification secret from bootstrapper application pipe."); |
| 679 | 679 | ||
| 680 | // Verify the secrets match. | 680 | // Verify the secrets match. |
diff --git a/src/burn/engine/burnpipe.cpp b/src/burn/engine/burnpipe.cpp index ec85822e..102ccb4f 100644 --- a/src/burn/engine/burnpipe.cpp +++ b/src/burn/engine/burnpipe.cpp | |||
| @@ -446,11 +446,11 @@ extern "C" HRESULT BurnPipeChildConnect( | |||
| 446 | 446 | ||
| 447 | // Try to connect to the parent. | 447 | // Try to connect to the parent. |
| 448 | hr = PipeClientConnect(pConnection->sczName, &pConnection->hPipe); | 448 | hr = PipeClientConnect(pConnection->sczName, &pConnection->hPipe); |
| 449 | ExitOnRootFailure(hr, "Failed to open parent pipe: %ls", sczPipeName) | 449 | ExitOnRootFailure(hr, "Failed to open parent pipe: %ls", pConnection->sczName) |
| 450 | 450 | ||
| 451 | // Verify the parent and notify it that the child connected. | 451 | // Verify the parent and notify it that the child connected. |
| 452 | hr = ChildPipeConnected(pConnection->hPipe, pConnection->sczSecret, &pConnection->dwProcessId); | 452 | hr = ChildPipeConnected(pConnection->hPipe, pConnection->sczSecret, &pConnection->dwProcessId); |
| 453 | ExitOnFailure(hr, "Failed to verify parent pipe: %ls", sczPipeName); | 453 | ExitOnFailure(hr, "Failed to verify parent pipe: %ls", pConnection->sczName); |
| 454 | 454 | ||
| 455 | if (fCompanion) | 455 | if (fCompanion) |
| 456 | { | 456 | { |
| @@ -511,7 +511,7 @@ static HRESULT ChildPipeConnected( | |||
| 511 | hr = StrAlloc(&sczVerificationSecret, cbVerificationSecret / sizeof(WCHAR) + 1); | 511 | hr = StrAlloc(&sczVerificationSecret, cbVerificationSecret / sizeof(WCHAR) + 1); |
| 512 | ExitOnFailure(hr, "Failed to allocate buffer for verification secret."); | 512 | ExitOnFailure(hr, "Failed to allocate buffer for verification secret."); |
| 513 | 513 | ||
| 514 | FileReadHandle(hPipe, reinterpret_cast<LPBYTE>(sczVerificationSecret), cbVerificationSecret); | 514 | hr = FileReadHandle(hPipe, reinterpret_cast<LPBYTE>(sczVerificationSecret), cbVerificationSecret); |
| 515 | ExitOnFailure(hr, "Failed to read verification secret from parent pipe."); | 515 | ExitOnFailure(hr, "Failed to read verification secret from parent pipe."); |
| 516 | 516 | ||
| 517 | // Verify the secrets match. | 517 | // Verify the secrets match. |
diff --git a/src/burn/engine/cabextract.cpp b/src/burn/engine/cabextract.cpp index 5663c3f7..2140130d 100644 --- a/src/burn/engine/cabextract.cpp +++ b/src/burn/engine/cabextract.cpp | |||
| @@ -833,9 +833,13 @@ static UINT FAR DIAMONDAPI CabWrite( | |||
| 833 | 833 | ||
| 834 | case BURN_CAB_OPERATION_STREAM_TO_BUFFER: | 834 | case BURN_CAB_OPERATION_STREAM_TO_BUFFER: |
| 835 | // copy to target buffer | 835 | // copy to target buffer |
| 836 | memcpy_s(pContext->Cabinet.pbTargetBuffer + pContext->Cabinet.iTargetBuffer, pContext->Cabinet.cbTargetBuffer - pContext->Cabinet.iTargetBuffer, pv, cb); | 836 | if (memcpy_s(pContext->Cabinet.pbTargetBuffer + pContext->Cabinet.iTargetBuffer, pContext->Cabinet.cbTargetBuffer - pContext->Cabinet.iTargetBuffer, pv, cb)) |
| 837 | pContext->Cabinet.iTargetBuffer += cb; | 837 | { |
| 838 | hr = E_INSUFFICIENT_BUFFER; | ||
| 839 | ExitOnRootFailure(hr, "Failed to copy data to target buffer during cabinet extraction."); | ||
| 840 | } | ||
| 838 | 841 | ||
| 842 | pContext->Cabinet.iTargetBuffer += cb; | ||
| 839 | cbWrite = cb; | 843 | cbWrite = cb; |
| 840 | break; | 844 | break; |
| 841 | 845 | ||
diff --git a/src/burn/engine/cache.cpp b/src/burn/engine/cache.cpp index f5df6500..c85a1be4 100644 --- a/src/burn/engine/cache.cpp +++ b/src/burn/engine/cache.cpp | |||
| @@ -363,6 +363,8 @@ extern "C" HRESULT CacheEnsureBaseWorkingFolder( | |||
| 363 | } | 363 | } |
| 364 | 364 | ||
| 365 | pWorkingFolderAcl = reinterpret_cast<LPSECURITY_ATTRIBUTES>(MemAlloc(sizeof(SECURITY_ATTRIBUTES), TRUE)); | 365 | pWorkingFolderAcl = reinterpret_cast<LPSECURITY_ATTRIBUTES>(MemAlloc(sizeof(SECURITY_ATTRIBUTES), TRUE)); |
| 366 | ExitOnNull(pWorkingFolderAcl, hr, E_OUTOFMEMORY, "Failed to allocate security attributes."); | ||
| 367 | |||
| 366 | pWorkingFolderAcl->nLength = sizeof(SECURITY_ATTRIBUTES); | 368 | pWorkingFolderAcl->nLength = sizeof(SECURITY_ATTRIBUTES); |
| 367 | pWorkingFolderAcl->lpSecurityDescriptor = psd; | 369 | pWorkingFolderAcl->lpSecurityDescriptor = psd; |
| 368 | pWorkingFolderAcl->bInheritHandle = FALSE; | 370 | pWorkingFolderAcl->bInheritHandle = FALSE; |
| @@ -857,6 +859,7 @@ extern "C" HRESULT CacheSendProgressCallback( | |||
| 857 | case PROGRESS_STOP: | 859 | case PROGRESS_STOP: |
| 858 | hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); | 860 | hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); |
| 859 | ExitOnRootFailure(hr, "UX aborted on download progress."); | 861 | ExitOnRootFailure(hr, "UX aborted on download progress."); |
| 862 | break; | ||
| 860 | 863 | ||
| 861 | case PROGRESS_QUIET: // Not actually an error, just an indication to the caller to stop requesting progress. | 864 | case PROGRESS_QUIET: // Not actually an error, just an indication to the caller to stop requesting progress. |
| 862 | pCallback->pfnProgress = NULL; | 865 | pCallback->pfnProgress = NULL; |
| @@ -866,6 +869,7 @@ extern "C" HRESULT CacheSendProgressCallback( | |||
| 866 | default: | 869 | default: |
| 867 | hr = E_UNEXPECTED; | 870 | hr = E_UNEXPECTED; |
| 868 | ExitOnRootFailure(hr, "Invalid return code from progress routine."); | 871 | ExitOnRootFailure(hr, "Invalid return code from progress routine."); |
| 872 | break; | ||
| 869 | } | 873 | } |
| 870 | } | 874 | } |
| 871 | 875 | ||
| @@ -1435,8 +1439,8 @@ extern "C" void CacheUninitialize( | |||
| 1435 | ReleaseStr(pCache->sczBaseWorkingFolder); | 1439 | ReleaseStr(pCache->sczBaseWorkingFolder); |
| 1436 | ReleaseStr(pCache->sczAcquisitionFolder); | 1440 | ReleaseStr(pCache->sczAcquisitionFolder); |
| 1437 | ReleaseStr(pCache->sczSourceProcessFolder); | 1441 | ReleaseStr(pCache->sczSourceProcessFolder); |
| 1438 | ReleaseStr(pCache->sczBundleEngineWorkingPath) | 1442 | ReleaseStr(pCache->sczBundleEngineWorkingPath); |
| 1439 | ReleaseFileHandle(pCache->hBundleEngineWorkingFile) | 1443 | ReleaseFileHandle(pCache->hBundleEngineWorkingFile); |
| 1440 | 1444 | ||
| 1441 | memset(pCache, 0, sizeof(BURN_CACHE)); | 1445 | memset(pCache, 0, sizeof(BURN_CACHE)); |
| 1442 | } | 1446 | } |
diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp index de202321..2dfa4857 100644 --- a/src/burn/engine/core.cpp +++ b/src/burn/engine/core.cpp | |||
| @@ -1232,8 +1232,11 @@ HRESULT CoreAppendLogToCommandLine( | |||
| 1232 | hr = StrAllocConcat(psczCommandLine, szLogArgFormatted, 0); | 1232 | hr = StrAllocConcat(psczCommandLine, szLogArgFormatted, 0); |
| 1233 | ExitOnFailure(hr, "Failed concatenating '-log' to command line"); | 1233 | ExitOnFailure(hr, "Failed concatenating '-log' to command line"); |
| 1234 | 1234 | ||
| 1235 | hr = StrAllocConcat(psczObfuscatedCommandLine, szLogArgFormatted, 0); | 1235 | if (psczObfuscatedCommandLine) |
| 1236 | ExitOnFailure(hr, "Failed concatenating '-log' to obfuscated command line"); | 1236 | { |
| 1237 | hr = StrAllocConcat(psczObfuscatedCommandLine, szLogArgFormatted, 0); | ||
| 1238 | ExitOnFailure(hr, "Failed concatenating '-log' to obfuscated command line"); | ||
| 1239 | } | ||
| 1237 | 1240 | ||
| 1238 | LExit: | 1241 | LExit: |
| 1239 | if (rgszArgs) | 1242 | if (rgszArgs) |
diff --git a/src/burn/engine/dependency.cpp b/src/burn/engine/dependency.cpp index 767d5004..5b55a48a 100644 --- a/src/burn/engine/dependency.cpp +++ b/src/burn/engine/dependency.cpp | |||
| @@ -591,8 +591,8 @@ extern "C" HRESULT DependencyPlanPackageBegin( | |||
| 591 | pProvider->dependentExecute = BURN_DEPENDENCY_ACTION_NONE; | 591 | pProvider->dependentExecute = BURN_DEPENDENCY_ACTION_NONE; |
| 592 | } | 592 | } |
| 593 | 593 | ||
| 594 | if (BURN_DEPENDENCY_ACTION_UNREGISTER == pProvider->dependentRollback && pProvider->fBundleRegisteredAsDependent || | 594 | if ((BURN_DEPENDENCY_ACTION_UNREGISTER == pProvider->dependentRollback && pProvider->fBundleRegisteredAsDependent) || |
| 595 | BURN_DEPENDENCY_ACTION_REGISTER == pProvider->dependentRollback && !pProvider->fBundleRegisteredAsDependent) | 595 | (BURN_DEPENDENCY_ACTION_REGISTER == pProvider->dependentRollback && !pProvider->fBundleRegisteredAsDependent)) |
| 596 | { | 596 | { |
| 597 | pProvider->dependentRollback = BURN_DEPENDENCY_ACTION_NONE; | 597 | pProvider->dependentRollback = BURN_DEPENDENCY_ACTION_NONE; |
| 598 | } | 598 | } |
diff --git a/src/burn/engine/elevation.cpp b/src/burn/engine/elevation.cpp index aff05ae3..ef87841f 100644 --- a/src/burn/engine/elevation.cpp +++ b/src/burn/engine/elevation.cpp | |||
| @@ -1452,9 +1452,9 @@ extern "C" HRESULT ElevationExecutePackageDependencyAction( | |||
| 1452 | ExitOnFailure(hr, "Failed to write bundle dependency key to message buffer."); | 1452 | ExitOnFailure(hr, "Failed to write bundle dependency key to message buffer."); |
| 1453 | 1453 | ||
| 1454 | // Dependent actions. | 1454 | // Dependent actions. |
| 1455 | for (DWORD i = 0; i < pExecuteAction->packageProvider.pPackage->cDependencyProviders; ++i) | 1455 | for (DWORD i = 0; i < pExecuteAction->packageDependency.pPackage->cDependencyProviders; ++i) |
| 1456 | { | 1456 | { |
| 1457 | BURN_DEPENDENCY_PROVIDER* pProvider = pExecuteAction->packageProvider.pPackage->rgDependencyProviders + i; | 1457 | BURN_DEPENDENCY_PROVIDER* pProvider = pExecuteAction->packageDependency.pPackage->rgDependencyProviders + i; |
| 1458 | BURN_DEPENDENCY_ACTION* pAction = fRollback ? &pProvider->dependentRollback : &pProvider->dependentExecute; | 1458 | BURN_DEPENDENCY_ACTION* pAction = fRollback ? &pProvider->dependentRollback : &pProvider->dependentExecute; |
| 1459 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)*pAction); | 1459 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)*pAction); |
| 1460 | ExitOnFailure(hr, "Failed to write dependent action to message buffer."); | 1460 | ExitOnFailure(hr, "Failed to write dependent action to message buffer."); |
| @@ -2824,7 +2824,7 @@ LExit: | |||
| 2824 | // TODO: do the right thing here. | 2824 | // TODO: do the right thing here. |
| 2825 | //DependencyUninitializeRegistrationAction(&action); | 2825 | //DependencyUninitializeRegistrationAction(&action); |
| 2826 | ReleaseStr(action.sczDependentProviderKey); | 2826 | ReleaseStr(action.sczDependentProviderKey); |
| 2827 | ReleaseStr(action.sczBundleCode) | 2827 | ReleaseStr(action.sczBundleCode); |
| 2828 | 2828 | ||
| 2829 | return hr; | 2829 | return hr; |
| 2830 | } | 2830 | } |
| @@ -3486,9 +3486,9 @@ static HRESULT OnExecutePackageDependencyAction( | |||
| 3486 | ExitOnFailure(hr, "Failed to read bundle dependency key from message buffer."); | 3486 | ExitOnFailure(hr, "Failed to read bundle dependency key from message buffer."); |
| 3487 | 3487 | ||
| 3488 | // Read dependent actions. | 3488 | // Read dependent actions. |
| 3489 | for (DWORD i = 0; i < executeAction.packageProvider.pPackage->cDependencyProviders; ++i) | 3489 | for (DWORD i = 0; i < executeAction.packageDependency.pPackage->cDependencyProviders; ++i) |
| 3490 | { | 3490 | { |
| 3491 | BURN_DEPENDENCY_PROVIDER* pProvider = executeAction.packageProvider.pPackage->rgDependencyProviders + i; | 3491 | BURN_DEPENDENCY_PROVIDER* pProvider = executeAction.packageDependency.pPackage->rgDependencyProviders + i; |
| 3492 | BURN_DEPENDENCY_ACTION* pAction = fRollback ? &pProvider->dependentRollback : &pProvider->dependentExecute; | 3492 | BURN_DEPENDENCY_ACTION* pAction = fRollback ? &pProvider->dependentRollback : &pProvider->dependentExecute; |
| 3493 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)pAction); | 3493 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)pAction); |
| 3494 | ExitOnFailure(hr, "Failed to read dependent action."); | 3494 | ExitOnFailure(hr, "Failed to read dependent action."); |
diff --git a/src/burn/engine/exeengine.cpp b/src/burn/engine/exeengine.cpp index 4df762da..c001e563 100644 --- a/src/burn/engine/exeengine.cpp +++ b/src/burn/engine/exeengine.cpp | |||
| @@ -449,7 +449,7 @@ extern "C" HRESULT ExeEngineExecutePackage( | |||
| 449 | 449 | ||
| 450 | if (BURN_EXE_DETECTION_TYPE_ARP == pPackage->Exe.detectionType && | 450 | if (BURN_EXE_DETECTION_TYPE_ARP == pPackage->Exe.detectionType && |
| 451 | (BOOTSTRAPPER_ACTION_STATE_UNINSTALL == pExecuteAction->exePackage.action || | 451 | (BOOTSTRAPPER_ACTION_STATE_UNINSTALL == pExecuteAction->exePackage.action || |
| 452 | BOOTSTRAPPER_ACTION_STATE_INSTALL == pExecuteAction->exePackage.action && fRollback)) | 452 | (BOOTSTRAPPER_ACTION_STATE_INSTALL == pExecuteAction->exePackage.action && fRollback))) |
| 453 | { | 453 | { |
| 454 | hr = DetectArpEntry(pPackage, &applyState, &sczArpUninstallString); | 454 | hr = DetectArpEntry(pPackage, &applyState, &sczArpUninstallString); |
| 455 | ExitOnFailure(hr, "Failed to query ArpEntry for %hs.", BOOTSTRAPPER_ACTION_STATE_UNINSTALL == pExecuteAction->exePackage.action ? "uninstall" : "install"); | 455 | ExitOnFailure(hr, "Failed to query ArpEntry for %hs.", BOOTSTRAPPER_ACTION_STATE_UNINSTALL == pExecuteAction->exePackage.action ? "uninstall" : "install"); |
diff --git a/src/burn/engine/logging.cpp b/src/burn/engine/logging.cpp index 51b546ad..52123499 100644 --- a/src/burn/engine/logging.cpp +++ b/src/burn/engine/logging.cpp | |||
| @@ -322,15 +322,17 @@ extern "C" HRESULT LoggingSetPackageVariable( | |||
| 322 | ExitFunction(); | 322 | ExitFunction(); |
| 323 | } | 323 | } |
| 324 | 324 | ||
| 325 | // For burn packages we'll add logging even it it wasn't explictly specified | 325 | // For burn packages we'll add logging even it it wasn't explictly specified. |
| 326 | if (BURN_PACKAGE_TYPE_BUNDLE == pPackage->type || (BURN_PACKAGE_TYPE_EXE == pPackage->type && BURN_EXE_PROTOCOL_TYPE_BURN == pPackage->Exe.protocol)) | 326 | if (BURN_PACKAGE_TYPE_BUNDLE == pPackage->type || (BURN_PACKAGE_TYPE_EXE == pPackage->type && BURN_EXE_PROTOCOL_TYPE_BURN == pPackage->Exe.protocol)) |
| 327 | { | 327 | { |
| 328 | if (!fRollback && (!pPackage->sczLogPathVariable || !*pPackage->sczLogPathVariable)) | 328 | if (!fRollback && (!pPackage->sczLogPathVariable || !*pPackage->sczLogPathVariable)) |
| 329 | { | 329 | { |
| 330 | // Best effort, no need to fail if we can't set the logging path. | ||
| 330 | StrAllocFormatted(&pPackage->sczLogPathVariable, L"WixBundleLog_%ls", pPackage->sczId); | 331 | StrAllocFormatted(&pPackage->sczLogPathVariable, L"WixBundleLog_%ls", pPackage->sczId); |
| 331 | } | 332 | } |
| 332 | else if (fRollback && (!pPackage->sczRollbackLogPathVariable || !*pPackage->sczRollbackLogPathVariable)) | 333 | else if (fRollback && (!pPackage->sczRollbackLogPathVariable || !*pPackage->sczRollbackLogPathVariable)) |
| 333 | { | 334 | { |
| 335 | // Best effort, no need to fail if we can't set the logging path. | ||
| 334 | StrAllocFormatted(&pPackage->sczRollbackLogPathVariable, L"WixBundleRollbackLog_%ls", pPackage->sczId); | 336 | StrAllocFormatted(&pPackage->sczRollbackLogPathVariable, L"WixBundleRollbackLog_%ls", pPackage->sczId); |
| 335 | } | 337 | } |
| 336 | } | 338 | } |
| @@ -1052,7 +1054,8 @@ static HRESULT GetNonSessionSpecificTempFolder( | |||
| 1052 | hr = ::StringCchLengthW(sczSessionId, STRSAFE_MAX_CCH, reinterpret_cast<size_t*>(&cchSessionId)); | 1054 | hr = ::StringCchLengthW(sczSessionId, STRSAFE_MAX_CCH, reinterpret_cast<size_t*>(&cchSessionId)); |
| 1053 | ExitOnFailure(hr, "Failed to get length of session id string."); | 1055 | ExitOnFailure(hr, "Failed to get length of session id string."); |
| 1054 | 1056 | ||
| 1055 | if (CSTR_EQUAL == ::CompareStringOrdinal(sczTempFolder + cchTempFolder - cchSessionId, static_cast<DWORD>(cchSessionId), sczSessionId, static_cast<DWORD>(cchSessionId), FALSE)) | 1057 | if (cchTempFolder >= cchSessionId && |
| 1058 | CSTR_EQUAL == ::CompareStringOrdinal(sczTempFolder + cchTempFolder - cchSessionId, static_cast<DWORD>(cchSessionId), sczSessionId, static_cast<DWORD>(cchSessionId), FALSE)) | ||
| 1056 | { | 1059 | { |
| 1057 | cchTempFolder -= cchSessionId; | 1060 | cchTempFolder -= cchSessionId; |
| 1058 | } | 1061 | } |
diff --git a/src/burn/engine/msiengine.cpp b/src/burn/engine/msiengine.cpp index 86fb0d9d..723ab16f 100644 --- a/src/burn/engine/msiengine.cpp +++ b/src/burn/engine/msiengine.cpp | |||
| @@ -2141,7 +2141,7 @@ static HRESULT ConcatFeatureActionProperties( | |||
| 2141 | 2141 | ||
| 2142 | if (sczAddLocal) | 2142 | if (sczAddLocal) |
| 2143 | { | 2143 | { |
| 2144 | hr = StrAllocFormatted(&scz, L" ADDLOCAL=\"%s\"", sczAddLocal, 0); | 2144 | hr = StrAllocFormatted(&scz, L" ADDLOCAL=\"%s\"", sczAddLocal); |
| 2145 | ExitOnFailure(hr, "Failed to format ADDLOCAL string."); | 2145 | ExitOnFailure(hr, "Failed to format ADDLOCAL string."); |
| 2146 | 2146 | ||
| 2147 | hr = StrAllocConcatSecure(psczArguments, scz, 0); | 2147 | hr = StrAllocConcatSecure(psczArguments, scz, 0); |
| @@ -2150,7 +2150,7 @@ static HRESULT ConcatFeatureActionProperties( | |||
| 2150 | 2150 | ||
| 2151 | if (sczAddSource) | 2151 | if (sczAddSource) |
| 2152 | { | 2152 | { |
| 2153 | hr = StrAllocFormatted(&scz, L" ADDSOURCE=\"%s\"", sczAddSource, 0); | 2153 | hr = StrAllocFormatted(&scz, L" ADDSOURCE=\"%s\"", sczAddSource); |
| 2154 | ExitOnFailure(hr, "Failed to format ADDSOURCE string."); | 2154 | ExitOnFailure(hr, "Failed to format ADDSOURCE string."); |
| 2155 | 2155 | ||
| 2156 | hr = StrAllocConcatSecure(psczArguments, scz, 0); | 2156 | hr = StrAllocConcatSecure(psczArguments, scz, 0); |
| @@ -2159,7 +2159,7 @@ static HRESULT ConcatFeatureActionProperties( | |||
| 2159 | 2159 | ||
| 2160 | if (sczAddDefault) | 2160 | if (sczAddDefault) |
| 2161 | { | 2161 | { |
| 2162 | hr = StrAllocFormatted(&scz, L" ADDDEFAULT=\"%s\"", sczAddDefault, 0); | 2162 | hr = StrAllocFormatted(&scz, L" ADDDEFAULT=\"%s\"", sczAddDefault); |
| 2163 | ExitOnFailure(hr, "Failed to format ADDDEFAULT string."); | 2163 | ExitOnFailure(hr, "Failed to format ADDDEFAULT string."); |
| 2164 | 2164 | ||
| 2165 | hr = StrAllocConcatSecure(psczArguments, scz, 0); | 2165 | hr = StrAllocConcatSecure(psczArguments, scz, 0); |
| @@ -2168,7 +2168,7 @@ static HRESULT ConcatFeatureActionProperties( | |||
| 2168 | 2168 | ||
| 2169 | if (sczReinstall) | 2169 | if (sczReinstall) |
| 2170 | { | 2170 | { |
| 2171 | hr = StrAllocFormatted(&scz, L" REINSTALL=\"%s\"", sczReinstall, 0); | 2171 | hr = StrAllocFormatted(&scz, L" REINSTALL=\"%s\"", sczReinstall); |
| 2172 | ExitOnFailure(hr, "Failed to format REINSTALL string."); | 2172 | ExitOnFailure(hr, "Failed to format REINSTALL string."); |
| 2173 | 2173 | ||
| 2174 | hr = StrAllocConcatSecure(psczArguments, scz, 0); | 2174 | hr = StrAllocConcatSecure(psczArguments, scz, 0); |
| @@ -2177,7 +2177,7 @@ static HRESULT ConcatFeatureActionProperties( | |||
| 2177 | 2177 | ||
| 2178 | if (sczAdvertise) | 2178 | if (sczAdvertise) |
| 2179 | { | 2179 | { |
| 2180 | hr = StrAllocFormatted(&scz, L" ADVERTISE=\"%s\"", sczAdvertise, 0); | 2180 | hr = StrAllocFormatted(&scz, L" ADVERTISE=\"%s\"", sczAdvertise); |
| 2181 | ExitOnFailure(hr, "Failed to format ADVERTISE string."); | 2181 | ExitOnFailure(hr, "Failed to format ADVERTISE string."); |
| 2182 | 2182 | ||
| 2183 | hr = StrAllocConcatSecure(psczArguments, scz, 0); | 2183 | hr = StrAllocConcatSecure(psczArguments, scz, 0); |
| @@ -2186,7 +2186,7 @@ static HRESULT ConcatFeatureActionProperties( | |||
| 2186 | 2186 | ||
| 2187 | if (sczRemove) | 2187 | if (sczRemove) |
| 2188 | { | 2188 | { |
| 2189 | hr = StrAllocFormatted(&scz, L" REMOVE=\"%s\"", sczRemove, 0); | 2189 | hr = StrAllocFormatted(&scz, L" REMOVE=\"%s\"", sczRemove); |
| 2190 | ExitOnFailure(hr, "Failed to format REMOVE string."); | 2190 | ExitOnFailure(hr, "Failed to format REMOVE string."); |
| 2191 | 2191 | ||
| 2192 | hr = StrAllocConcatSecure(psczArguments, scz, 0); | 2192 | hr = StrAllocConcatSecure(psczArguments, scz, 0); |
diff --git a/src/burn/engine/msuengine.cpp b/src/burn/engine/msuengine.cpp index 43f5f76c..d31691a5 100644 --- a/src/burn/engine/msuengine.cpp +++ b/src/burn/engine/msuengine.cpp | |||
| @@ -313,6 +313,8 @@ LExit: | |||
| 313 | SetServiceStartType(schWu, SERVICE_DISABLED); | 313 | SetServiceStartType(schWu, SERVICE_DISABLED); |
| 314 | } | 314 | } |
| 315 | 315 | ||
| 316 | ReleaseServiceHandle(schWu); | ||
| 317 | |||
| 316 | // Best effort to clear the execute package cache folder variable. | 318 | // Best effort to clear the execute package cache folder variable. |
| 317 | VariableSetString(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_CACHE_FOLDER, NULL, TRUE, FALSE); | 319 | VariableSetString(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_CACHE_FOLDER, NULL, TRUE, FALSE); |
| 318 | 320 | ||
diff --git a/src/burn/engine/plan.cpp b/src/burn/engine/plan.cpp index 7994dd32..e8e796fb 100644 --- a/src/burn/engine/plan.cpp +++ b/src/burn/engine/plan.cpp | |||
| @@ -1508,7 +1508,7 @@ extern "C" HRESULT PlanRelatedBundlesComplete( | |||
| 1508 | for (DWORD i = 0; i < pPlan->cExecuteActions; ++i) | 1508 | for (DWORD i = 0; i < pPlan->cExecuteActions; ++i) |
| 1509 | { | 1509 | { |
| 1510 | BOOTSTRAPPER_ACTION_STATE packageAction = BOOTSTRAPPER_ACTION_STATE_NONE; | 1510 | BOOTSTRAPPER_ACTION_STATE packageAction = BOOTSTRAPPER_ACTION_STATE_NONE; |
| 1511 | BURN_PACKAGE* pPackage = &pPlan->rgExecuteActions[i].relatedBundle.pRelatedBundle->package; | 1511 | BURN_PACKAGE* pPackage = NULL; |
| 1512 | BOOL fBundle = FALSE; | 1512 | BOOL fBundle = FALSE; |
| 1513 | 1513 | ||
| 1514 | switch (pPlan->rgExecuteActions[i].type) | 1514 | switch (pPlan->rgExecuteActions[i].type) |
| @@ -1540,7 +1540,7 @@ extern "C" HRESULT PlanRelatedBundlesComplete( | |||
| 1540 | 1540 | ||
| 1541 | if (fBundle && BOOTSTRAPPER_ACTION_STATE_NONE != packageAction) | 1541 | if (fBundle && BOOTSTRAPPER_ACTION_STATE_NONE != packageAction) |
| 1542 | { | 1542 | { |
| 1543 | if (pPackage->cDependencyProviders) | 1543 | if (pPackage && pPackage->cDependencyProviders) |
| 1544 | { | 1544 | { |
| 1545 | // Bundles only support a single provider key. | 1545 | // Bundles only support a single provider key. |
| 1546 | const BURN_DEPENDENCY_PROVIDER* pProvider = pPackage->rgDependencyProviders; | 1546 | const BURN_DEPENDENCY_PROVIDER* pProvider = pPackage->rgDependencyProviders; |
| @@ -2013,6 +2013,7 @@ extern "C" HRESULT PlanRollbackBoundaryComplete( | |||
| 2013 | 2013 | ||
| 2014 | // Add checkpoints. | 2014 | // Add checkpoints. |
| 2015 | hr = PlanExecuteCheckpoint(pPlan); | 2015 | hr = PlanExecuteCheckpoint(pPlan); |
| 2016 | ExitOnFailure(hr, "Failed to append execute checkpoint for rollback boundary complete."); | ||
| 2016 | 2017 | ||
| 2017 | // Add complete rollback boundary to execute plan. | 2018 | // Add complete rollback boundary to execute plan. |
| 2018 | hr = PlanAppendExecuteAction(pPlan, &pExecuteAction); | 2019 | hr = PlanAppendExecuteAction(pPlan, &pExecuteAction); |
| @@ -2948,9 +2949,9 @@ static void ExecuteActionLog( | |||
| 2948 | 2949 | ||
| 2949 | case BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY: | 2950 | case BURN_EXECUTE_ACTION_TYPE_PACKAGE_DEPENDENCY: |
| 2950 | LogStringLine(PlanDumpLevel, "%ls action[%u]: PACKAGE_DEPENDENCY package id: %ls, bundle provider key: %ls", wzBase, iAction, pAction->packageDependency.pPackage->sczId, pAction->packageDependency.sczBundleProviderKey); | 2951 | LogStringLine(PlanDumpLevel, "%ls action[%u]: PACKAGE_DEPENDENCY package id: %ls, bundle provider key: %ls", wzBase, iAction, pAction->packageDependency.pPackage->sczId, pAction->packageDependency.sczBundleProviderKey); |
| 2951 | for (DWORD j = 0; j < pAction->packageProvider.pPackage->cDependencyProviders; ++j) | 2952 | for (DWORD j = 0; j < pAction->packageDependency.pPackage->cDependencyProviders; ++j) |
| 2952 | { | 2953 | { |
| 2953 | const BURN_DEPENDENCY_PROVIDER* pProvider = pAction->packageProvider.pPackage->rgDependencyProviders + j; | 2954 | const BURN_DEPENDENCY_PROVIDER* pProvider = pAction->packageDependency.pPackage->rgDependencyProviders + j; |
| 2954 | LogStringLine(PlanDumpLevel, " Provider[%u]: key: %ls, action: %hs", j, pProvider->sczKey, LoggingDependencyActionToString(fRollback ? pProvider->dependentRollback : pProvider->dependentExecute)); | 2955 | LogStringLine(PlanDumpLevel, " Provider[%u]: key: %ls, action: %hs", j, pProvider->sczKey, LoggingDependencyActionToString(fRollback ? pProvider->dependentRollback : pProvider->dependentExecute)); |
| 2955 | } | 2956 | } |
| 2956 | break; | 2957 | break; |
diff --git a/src/burn/engine/pseudobundle.cpp b/src/burn/engine/pseudobundle.cpp index f0d67068..02aed9f9 100644 --- a/src/burn/engine/pseudobundle.cpp +++ b/src/burn/engine/pseudobundle.cpp | |||
| @@ -127,8 +127,8 @@ extern "C" HRESULT PseudoBundleInitializePassthrough( | |||
| 127 | ExitOnFailure(hr, "Failed to copy cache id for passthrough pseudo bundle."); | 127 | ExitOnFailure(hr, "Failed to copy cache id for passthrough pseudo bundle."); |
| 128 | 128 | ||
| 129 | // Log variables - best effort | 129 | // Log variables - best effort |
| 130 | StrAllocFormatted(&pPackage->sczLogPathVariable, L"WixBundleLog_%ls", pPackage->sczId); | 130 | StrAllocFormatted(&pPassthroughPackage->sczLogPathVariable, L"WixBundleLog_%ls", pPackage->sczId); |
| 131 | StrAllocFormatted(&pPackage->sczRollbackLogPathVariable, L"WixBundleRollbackLog_%ls", pPackage->sczId); | 131 | StrAllocFormatted(&pPassthroughPackage->sczRollbackLogPathVariable, L"WixBundleRollbackLog_%ls", pPackage->sczId); |
| 132 | 132 | ||
| 133 | hr = CoreCreatePassthroughBundleCommandLine(&sczArguments, pInternalCommand, pCommand); | 133 | hr = CoreCreatePassthroughBundleCommandLine(&sczArguments, pInternalCommand, pCommand); |
| 134 | ExitOnFailure(hr, "Failed to create command-line arguments."); | 134 | ExitOnFailure(hr, "Failed to create command-line arguments."); |
| @@ -155,6 +155,8 @@ extern "C" HRESULT PseudoBundleInitializeUpdateBundle( | |||
| 155 | { | 155 | { |
| 156 | HRESULT hr = S_OK; | 156 | HRESULT hr = S_OK; |
| 157 | BURN_PAYLOAD* pPayload = NULL; | 157 | BURN_PAYLOAD* pPayload = NULL; |
| 158 | BYTE* rgbHash = NULL; | ||
| 159 | DWORD cbHash = 0; | ||
| 158 | 160 | ||
| 159 | // Initialize the single payload, and fill out all the necessary fields | 161 | // Initialize the single payload, and fill out all the necessary fields |
| 160 | pPackage->payloads.rgItems = (BURN_PAYLOAD_GROUP_ITEM*)MemAlloc(sizeof(BURN_PAYLOAD_GROUP_ITEM), TRUE); | 162 | pPackage->payloads.rgItems = (BURN_PAYLOAD_GROUP_ITEM*)MemAlloc(sizeof(BURN_PAYLOAD_GROUP_ITEM), TRUE); |
| @@ -185,9 +187,6 @@ extern "C" HRESULT PseudoBundleInitializeUpdateBundle( | |||
| 185 | 187 | ||
| 186 | if (wzHash && *wzHash) | 188 | if (wzHash && *wzHash) |
| 187 | { | 189 | { |
| 188 | BYTE* rgbHash = NULL; | ||
| 189 | DWORD cbHash = 0; | ||
| 190 | |||
| 191 | hr = StrAllocHexDecode(wzHash, &rgbHash, &cbHash); | 190 | hr = StrAllocHexDecode(wzHash, &rgbHash, &cbHash); |
| 192 | ExitOnFailure(hr, "Failed to decode hash string: %ls.", wzHash); | 191 | ExitOnFailure(hr, "Failed to decode hash string: %ls.", wzHash); |
| 193 | 192 | ||
| @@ -223,5 +222,7 @@ extern "C" HRESULT PseudoBundleInitializeUpdateBundle( | |||
| 223 | ExitOnFailure(hr, "Failed to copy install arguments for update bundle package"); | 222 | ExitOnFailure(hr, "Failed to copy install arguments for update bundle package"); |
| 224 | 223 | ||
| 225 | LExit: | 224 | LExit: |
| 225 | ReleaseMem(rgbHash); | ||
| 226 | |||
| 226 | return hr; | 227 | return hr; |
| 227 | } | 228 | } |
diff --git a/src/burn/engine/search.cpp b/src/burn/engine/search.cpp index 1f128e95..a60215fe 100644 --- a/src/burn/engine/search.cpp +++ b/src/burn/engine/search.cpp | |||
| @@ -334,7 +334,7 @@ extern "C" HRESULT SearchesParseFromXml( | |||
| 334 | { | 334 | { |
| 335 | pSearch->MsiProductSearch.Type = BURN_MSI_PRODUCT_SEARCH_TYPE_ASSIGNMENT; | 335 | pSearch->MsiProductSearch.Type = BURN_MSI_PRODUCT_SEARCH_TYPE_ASSIGNMENT; |
| 336 | } | 336 | } |
| 337 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, 0, scz, -1, L"exists", -1)) | 337 | else if (CSTR_EQUAL == ::CompareStringOrdinal(scz, -1, L"exists", -1, FALSE)) |
| 338 | { | 338 | { |
| 339 | pSearch->MsiProductSearch.Type = BURN_MSI_PRODUCT_SEARCH_TYPE_EXISTS; | 339 | pSearch->MsiProductSearch.Type = BURN_MSI_PRODUCT_SEARCH_TYPE_EXISTS; |
| 340 | } | 340 | } |
diff --git a/src/burn/engine/variant.cpp b/src/burn/engine/variant.cpp index 2267ee7b..3fc02aa8 100644 --- a/src/burn/engine/variant.cpp +++ b/src/burn/engine/variant.cpp | |||
| @@ -10,6 +10,9 @@ static HRESULT GetVersionInternal( | |||
| 10 | __in BOOL fSilent, | 10 | __in BOOL fSilent, |
| 11 | __out VERUTIL_VERSION** ppValue | 11 | __out VERUTIL_VERSION** ppValue |
| 12 | ); | 12 | ); |
| 13 | static void FreeVariantValue( | ||
| 14 | __in BURN_VARIANT* pVariant | ||
| 15 | ); | ||
| 13 | 16 | ||
| 14 | // function definitions | 17 | // function definitions |
| 15 | 18 | ||
| @@ -17,12 +20,7 @@ extern "C" void BVariantUninitialize( | |||
| 17 | __in BURN_VARIANT* pVariant | 20 | __in BURN_VARIANT* pVariant |
| 18 | ) | 21 | ) |
| 19 | { | 22 | { |
| 20 | if (BURN_VARIANT_TYPE_FORMATTED == pVariant->Type || | 23 | FreeVariantValue(pVariant); |
| 21 | BURN_VARIANT_TYPE_STRING == pVariant->Type) | ||
| 22 | { | ||
| 23 | StrSecureZeroFreeString(pVariant->sczValue); | ||
| 24 | } | ||
| 25 | SecureZeroMemory(pVariant, sizeof(BURN_VARIANT)); | ||
| 26 | } | 24 | } |
| 27 | 25 | ||
| 28 | extern "C" HRESULT BVariantGetNumeric( | 26 | extern "C" HRESULT BVariantGetNumeric( |
| @@ -164,12 +162,8 @@ extern "C" HRESULT BVariantSetNumeric( | |||
| 164 | { | 162 | { |
| 165 | HRESULT hr = S_OK; | 163 | HRESULT hr = S_OK; |
| 166 | 164 | ||
| 167 | if (BURN_VARIANT_TYPE_FORMATTED == pVariant->Type || | 165 | FreeVariantValue(pVariant); |
| 168 | BURN_VARIANT_TYPE_STRING == pVariant->Type) | 166 | |
| 169 | { | ||
| 170 | StrSecureZeroFreeString(pVariant->sczValue); | ||
| 171 | } | ||
| 172 | memset(pVariant, 0, sizeof(BURN_VARIANT)); | ||
| 173 | pVariant->llValue = llValue; | 167 | pVariant->llValue = llValue; |
| 174 | pVariant->Type = BURN_VARIANT_TYPE_NUMERIC; | 168 | pVariant->Type = BURN_VARIANT_TYPE_NUMERIC; |
| 175 | 169 | ||
| @@ -194,7 +188,7 @@ extern "C" HRESULT BVariantSetString( | |||
| 194 | if (BURN_VARIANT_TYPE_FORMATTED != pVariant->Type && | 188 | if (BURN_VARIANT_TYPE_FORMATTED != pVariant->Type && |
| 195 | BURN_VARIANT_TYPE_STRING != pVariant->Type) | 189 | BURN_VARIANT_TYPE_STRING != pVariant->Type) |
| 196 | { | 190 | { |
| 197 | memset(pVariant, 0, sizeof(BURN_VARIANT)); | 191 | FreeVariantValue(pVariant); |
| 198 | } | 192 | } |
| 199 | 193 | ||
| 200 | hr = StrAllocStringSecure(&pVariant->sczValue, wzValue, cchValue); | 194 | hr = StrAllocStringSecure(&pVariant->sczValue, wzValue, cchValue); |
| @@ -220,12 +214,8 @@ extern "C" HRESULT BVariantSetVersion( | |||
| 220 | } | 214 | } |
| 221 | else // assign the value. | 215 | else // assign the value. |
| 222 | { | 216 | { |
| 223 | if (BURN_VARIANT_TYPE_FORMATTED == pVariant->Type || | 217 | FreeVariantValue(pVariant); |
| 224 | BURN_VARIANT_TYPE_STRING == pVariant->Type) | 218 | |
| 225 | { | ||
| 226 | StrSecureZeroFreeString(pVariant->sczValue); | ||
| 227 | } | ||
| 228 | memset(pVariant, 0, sizeof(BURN_VARIANT)); | ||
| 229 | hr = VerCopyVersion(pValue, &pVariant->pValue); | 219 | hr = VerCopyVersion(pValue, &pVariant->pValue); |
| 230 | pVariant->Type = BURN_VARIANT_TYPE_VERSION; | 220 | pVariant->Type = BURN_VARIANT_TYPE_VERSION; |
| 231 | } | 221 | } |
| @@ -319,3 +309,20 @@ extern "C" HRESULT BVariantChangeType( | |||
| 319 | LExit: | 309 | LExit: |
| 320 | return hr; | 310 | return hr; |
| 321 | } | 311 | } |
| 312 | |||
| 313 | static void FreeVariantValue( | ||
| 314 | __in BURN_VARIANT* pVariant | ||
| 315 | ) | ||
| 316 | { | ||
| 317 | if ((BURN_VARIANT_TYPE_FORMATTED == pVariant->Type || BURN_VARIANT_TYPE_STRING == pVariant->Type) && | ||
| 318 | pVariant->sczValue) | ||
| 319 | { | ||
| 320 | StrSecureZeroFreeString(pVariant->sczValue); | ||
| 321 | } | ||
| 322 | else if (BURN_VARIANT_TYPE_VERSION == pVariant->Type && pVariant->pValue) | ||
| 323 | { | ||
| 324 | VerFreeVersion(pVariant->pValue); | ||
| 325 | } | ||
| 326 | |||
| 327 | SecureZeroMemory(pVariant, sizeof(BURN_VARIANT)); | ||
| 328 | } | ||
