summaryrefslogtreecommitdiff
path: root/src/burn/engine/exeengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/burn/engine/exeengine.cpp')
-rw-r--r--src/burn/engine/exeengine.cpp28
1 files changed, 22 insertions, 6 deletions
diff --git a/src/burn/engine/exeengine.cpp b/src/burn/engine/exeengine.cpp
index a287d171..c3757e92 100644
--- a/src/burn/engine/exeengine.cpp
+++ b/src/burn/engine/exeengine.cpp
@@ -361,17 +361,33 @@ extern "C" HRESULT ExeEngineExecutePackage(
361 BURN_PACKAGE* pPackage = pExecuteAction->exePackage.pPackage; 361 BURN_PACKAGE* pPackage = pExecuteAction->exePackage.pPackage;
362 BURN_PAYLOAD* pPackagePayload = pPackage->payloads.rgItems[0].pPayload; 362 BURN_PAYLOAD* pPackagePayload = pPackage->payloads.rgItems[0].pPayload;
363 363
364 // get cached executable path 364 if (pPackage->Exe.fPseudoPackage && BURN_PAYLOAD_VERIFICATION_UPDATE_BUNDLE != pPackagePayload->verification)
365 hr = CacheGetCompletedPath(pCache, pPackage->fPerMachine, pPackage->sczCacheId, &sczCachedDirectory); 365 {
366 ExitOnFailure(hr, "Failed to get cached path for package: %ls", pPackage->sczId); 366 if (!PathIsFullyQualified(pPackagePayload->sczFilePath, NULL))
367 {
368 ExitWithRootFailure(hr, E_INVALIDSTATE, "Pseudo ExePackages must have a fully qualified target path.");
369 }
370
371 hr = StrAllocString(&sczExecutablePath, pPackagePayload->sczFilePath, 0);
372 ExitOnFailure(hr, "Failed to build executable path.");
373
374 hr = PathGetDirectory(sczExecutablePath, &sczCachedDirectory);
375 ExitOnFailure(hr, "Failed to get cached path for pseudo-package: %ls", pPackage->sczId);
376 }
377 else
378 {
379 // get cached executable path
380 hr = CacheGetCompletedPath(pCache, pPackage->fPerMachine, pPackage->sczCacheId, &sczCachedDirectory);
381 ExitOnFailure(hr, "Failed to get cached path for package: %ls", pPackage->sczId);
382
383 hr = PathConcatRelativeToBase(sczCachedDirectory, pPackagePayload->sczFilePath, &sczExecutablePath);
384 ExitOnFailure(hr, "Failed to build executable path.");
385 }
367 386
368 // Best effort to set the execute package cache folder and action variables. 387 // Best effort to set the execute package cache folder and action variables.
369 VariableSetString(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_CACHE_FOLDER, sczCachedDirectory, TRUE, FALSE); 388 VariableSetString(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_CACHE_FOLDER, sczCachedDirectory, TRUE, FALSE);
370 VariableSetNumeric(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_ACTION, pExecuteAction->exePackage.action, TRUE); 389 VariableSetNumeric(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_ACTION, pExecuteAction->exePackage.action, TRUE);
371 390
372 hr = PathConcat(sczCachedDirectory, pPackagePayload->sczFilePath, &sczExecutablePath);
373 ExitOnFailure(hr, "Failed to build executable path.");
374
375 // pick arguments 391 // pick arguments
376 switch (pExecuteAction->exePackage.action) 392 switch (pExecuteAction->exePackage.action)
377 { 393 {