aboutsummaryrefslogtreecommitdiff
path: root/src/engine/exeengine.cpp
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-04-16 10:09:26 -0500
committerSean Hall <r.sean.hall@gmail.com>2021-04-19 23:12:55 -0500
commit90cdf39e6e6b7d676ca33bee031fa2b865bb5fbd (patch)
tree901feb035d5ea9a13f306582cedd6668b539953f /src/engine/exeengine.cpp
parentc88806b89293f5bb92c42e90230e48be6b79b7f4 (diff)
downloadwix-90cdf39e6e6b7d676ca33bee031fa2b865bb5fbd.tar.gz
wix-90cdf39e6e6b7d676ca33bee031fa2b865bb5fbd.tar.bz2
wix-90cdf39e6e6b7d676ca33bee031fa2b865bb5fbd.zip
Don't plan payloads.
Contributes to #3640 and #5253
Diffstat (limited to 'src/engine/exeengine.cpp')
-rw-r--r--src/engine/exeengine.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/engine/exeengine.cpp b/src/engine/exeengine.cpp
index 46905fc3..9b1b6973 100644
--- a/src/engine/exeengine.cpp
+++ b/src/engine/exeengine.cpp
@@ -372,31 +372,33 @@ extern "C" HRESULT ExeEngineExecutePackage(
372 PROCESS_INFORMATION pi = { }; 372 PROCESS_INFORMATION pi = { };
373 DWORD dwExitCode = 0; 373 DWORD dwExitCode = 0;
374 GENERIC_EXECUTE_MESSAGE message = { }; 374 GENERIC_EXECUTE_MESSAGE message = { };
375 BURN_PACKAGE* pPackage = pExecuteAction->exePackage.pPackage;
376 BURN_PAYLOAD* pPackagePayload = pPackage->payloads.rgpPayloads[0];
375 377
376 // get cached executable path 378 // get cached executable path
377 hr = CacheGetCompletedPath(pExecuteAction->exePackage.pPackage->fPerMachine, pExecuteAction->exePackage.pPackage->sczCacheId, &sczCachedDirectory); 379 hr = CacheGetCompletedPath(pPackage->fPerMachine, pPackage->sczCacheId, &sczCachedDirectory);
378 ExitOnFailure(hr, "Failed to get cached path for package: %ls", pExecuteAction->exePackage.pPackage->sczId); 380 ExitOnFailure(hr, "Failed to get cached path for package: %ls", pPackage->sczId);
379 381
380 // Best effort to set the execute package cache folder and action variables. 382 // Best effort to set the execute package cache folder and action variables.
381 VariableSetString(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_CACHE_FOLDER, sczCachedDirectory, TRUE, FALSE); 383 VariableSetString(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_CACHE_FOLDER, sczCachedDirectory, TRUE, FALSE);
382 VariableSetNumeric(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_ACTION, pExecuteAction->exePackage.action, TRUE); 384 VariableSetNumeric(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_ACTION, pExecuteAction->exePackage.action, TRUE);
383 385
384 hr = PathConcat(sczCachedDirectory, pExecuteAction->exePackage.pPackage->rgPayloads[0].pPayload->sczFilePath, &sczExecutablePath); 386 hr = PathConcat(sczCachedDirectory, pPackagePayload->sczFilePath, &sczExecutablePath);
385 ExitOnFailure(hr, "Failed to build executable path."); 387 ExitOnFailure(hr, "Failed to build executable path.");
386 388
387 // pick arguments 389 // pick arguments
388 switch (pExecuteAction->exePackage.action) 390 switch (pExecuteAction->exePackage.action)
389 { 391 {
390 case BOOTSTRAPPER_ACTION_STATE_INSTALL: 392 case BOOTSTRAPPER_ACTION_STATE_INSTALL:
391 wzArguments = pExecuteAction->exePackage.pPackage->Exe.sczInstallArguments; 393 wzArguments = pPackage->Exe.sczInstallArguments;
392 break; 394 break;
393 395
394 case BOOTSTRAPPER_ACTION_STATE_UNINSTALL: 396 case BOOTSTRAPPER_ACTION_STATE_UNINSTALL:
395 wzArguments = pExecuteAction->exePackage.pPackage->Exe.sczUninstallArguments; 397 wzArguments = pPackage->Exe.sczUninstallArguments;
396 break; 398 break;
397 399
398 case BOOTSTRAPPER_ACTION_STATE_REPAIR: 400 case BOOTSTRAPPER_ACTION_STATE_REPAIR:
399 wzArguments = pExecuteAction->exePackage.pPackage->Exe.sczRepairArguments; 401 wzArguments = pPackage->Exe.sczRepairArguments;
400 break; 402 break;
401 403
402 default: 404 default:
@@ -408,9 +410,9 @@ extern "C" HRESULT ExeEngineExecutePackage(
408 hr = StrAllocString(&sczArguments, wzArguments && *wzArguments ? wzArguments : L"", 0); 410 hr = StrAllocString(&sczArguments, wzArguments && *wzArguments ? wzArguments : L"", 0);
409 ExitOnFailure(hr, "Failed to copy package arguments."); 411 ExitOnFailure(hr, "Failed to copy package arguments.");
410 412
411 for (DWORD i = 0; i < pExecuteAction->exePackage.pPackage->Exe.cCommandLineArguments; ++i) 413 for (DWORD i = 0; i < pPackage->Exe.cCommandLineArguments; ++i)
412 { 414 {
413 BURN_EXE_COMMAND_LINE_ARGUMENT* commandLineArgument = &pExecuteAction->exePackage.pPackage->Exe.rgCommandLineArguments[i]; 415 BURN_EXE_COMMAND_LINE_ARGUMENT* commandLineArgument = &pPackage->Exe.rgCommandLineArguments[i];
414 BOOL fCondition = FALSE; 416 BOOL fCondition = FALSE;
415 417
416 hr = ConditionEvaluate(pVariables, commandLineArgument->sczCondition, &fCondition); 418 hr = ConditionEvaluate(pVariables, commandLineArgument->sczCondition, &fCondition);
@@ -468,10 +470,10 @@ extern "C" HRESULT ExeEngineExecutePackage(
468 } 470 }
469 ExitOnFailure(hr, "Failed to create obfuscated executable command."); 471 ExitOnFailure(hr, "Failed to create obfuscated executable command.");
470 472
471 if (pExecuteAction->exePackage.pPackage->Exe.fSupportsAncestors) 473 if (pPackage->Exe.fSupportsAncestors)
472 { 474 {
473 // Add the list of dependencies to ignore, if any, to the burn command line. 475 // Add the list of dependencies to ignore, if any, to the burn command line.
474 if (pExecuteAction->exePackage.sczIgnoreDependencies && BURN_EXE_PROTOCOL_TYPE_BURN == pExecuteAction->exePackage.pPackage->Exe.protocol) 476 if (pExecuteAction->exePackage.sczIgnoreDependencies && BURN_EXE_PROTOCOL_TYPE_BURN == pPackage->Exe.protocol)
475 { 477 {
476 hr = StrAllocFormattedSecure(&sczCommand, L"%ls -%ls=%ls", sczCommand, BURN_COMMANDLINE_SWITCH_IGNOREDEPENDENCIES, pExecuteAction->exePackage.sczIgnoreDependencies); 478 hr = StrAllocFormattedSecure(&sczCommand, L"%ls -%ls=%ls", sczCommand, BURN_COMMANDLINE_SWITCH_IGNOREDEPENDENCIES, pExecuteAction->exePackage.sczIgnoreDependencies);
477 ExitOnFailure(hr, "Failed to append the list of dependencies to ignore to the command line."); 479 ExitOnFailure(hr, "Failed to append the list of dependencies to ignore to the command line.");
@@ -491,21 +493,21 @@ extern "C" HRESULT ExeEngineExecutePackage(
491 } 493 }
492 } 494 }
493 495
494 if (BURN_EXE_PROTOCOL_TYPE_BURN == pExecuteAction->exePackage.pPackage->Exe.protocol) 496 if (BURN_EXE_PROTOCOL_TYPE_BURN == pPackage->Exe.protocol)
495 { 497 {
496 hr = CoreAppendFileHandleSelfToCommandLine(sczExecutablePath, &hExecutableFile, &sczCommand, &sczCommandObfuscated); 498 hr = CoreAppendFileHandleSelfToCommandLine(sczExecutablePath, &hExecutableFile, &sczCommand, &sczCommandObfuscated);
497 ExitOnFailure(hr, "Failed to append %ls", BURN_COMMANDLINE_SWITCH_FILEHANDLE_SELF); 499 ExitOnFailure(hr, "Failed to append %ls", BURN_COMMANDLINE_SWITCH_FILEHANDLE_SELF);
498 } 500 }
499 501
500 // Log before we add the secret pipe name and client token for embedded processes. 502 // Log before we add the secret pipe name and client token for embedded processes.
501 LogId(REPORT_STANDARD, MSG_APPLYING_PACKAGE, LoggingRollbackOrExecute(fRollback), pExecuteAction->exePackage.pPackage->sczId, LoggingActionStateToString(pExecuteAction->exePackage.action), sczExecutablePath, sczCommandObfuscated); 503 LogId(REPORT_STANDARD, MSG_APPLYING_PACKAGE, LoggingRollbackOrExecute(fRollback), pPackage->sczId, LoggingActionStateToString(pExecuteAction->exePackage.action), sczExecutablePath, sczCommandObfuscated);
502 504
503 if (!pExecuteAction->exePackage.fFireAndForget && BURN_EXE_PROTOCOL_TYPE_BURN == pExecuteAction->exePackage.pPackage->Exe.protocol) 505 if (!pExecuteAction->exePackage.fFireAndForget && BURN_EXE_PROTOCOL_TYPE_BURN == pPackage->Exe.protocol)
504 { 506 {
505 hr = EmbeddedRunBundle(sczExecutablePath, sczCommand, pfnGenericMessageHandler, pvContext, &dwExitCode); 507 hr = EmbeddedRunBundle(sczExecutablePath, sczCommand, pfnGenericMessageHandler, pvContext, &dwExitCode);
506 ExitOnFailure(hr, "Failed to run bundle as embedded from path: %ls", sczExecutablePath); 508 ExitOnFailure(hr, "Failed to run bundle as embedded from path: %ls", sczExecutablePath);
507 } 509 }
508 else if (!pExecuteAction->exePackage.fFireAndForget && BURN_EXE_PROTOCOL_TYPE_NETFX4 == pExecuteAction->exePackage.pPackage->Exe.protocol) 510 else if (!pExecuteAction->exePackage.fFireAndForget && BURN_EXE_PROTOCOL_TYPE_NETFX4 == pPackage->Exe.protocol)
509 { 511 {
510 hr = NetFxRunChainer(sczExecutablePath, sczCommand, pfnGenericMessageHandler, pvContext, &dwExitCode); 512 hr = NetFxRunChainer(sczExecutablePath, sczCommand, pfnGenericMessageHandler, pvContext, &dwExitCode);
511 ExitOnFailure(hr, "Failed to run netfx chainer: %ls", sczExecutablePath); 513 ExitOnFailure(hr, "Failed to run netfx chainer: %ls", sczExecutablePath);
@@ -543,7 +545,7 @@ extern "C" HRESULT ExeEngineExecutePackage(
543 } while (HRESULT_FROM_WIN32(WAIT_TIMEOUT) == hr); 545 } while (HRESULT_FROM_WIN32(WAIT_TIMEOUT) == hr);
544 } 546 }
545 547
546 hr = HandleExitCode(pExecuteAction->exePackage.pPackage, dwExitCode, pRestart); 548 hr = HandleExitCode(pPackage, dwExitCode, pRestart);
547 ExitOnRootFailure(hr, "Process returned error: 0x%x", dwExitCode); 549 ExitOnRootFailure(hr, "Process returned error: 0x%x", dwExitCode);
548 550
549LExit: 551LExit: