summaryrefslogtreecommitdiff
path: root/src/burn/engine/plan.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/burn/engine/plan.cpp')
-rw-r--r--src/burn/engine/plan.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/burn/engine/plan.cpp b/src/burn/engine/plan.cpp
index 68c1d2ba..52bf6298 100644
--- a/src/burn/engine/plan.cpp
+++ b/src/burn/engine/plan.cpp
@@ -432,24 +432,28 @@ extern "C" HRESULT PlanLayoutBundle(
432{ 432{
433 HRESULT hr = S_OK; 433 HRESULT hr = S_OK;
434 BURN_CACHE_ACTION* pCacheAction = NULL; 434 BURN_CACHE_ACTION* pCacheAction = NULL;
435 LPWSTR sczLayoutDirectory = NULL;
435 LPWSTR sczExecutablePath = NULL; 436 LPWSTR sczExecutablePath = NULL;
436 437
437 // Get the layout directory. 438 // Get the layout directory.
438 hr = VariableGetString(pVariables, BURN_BUNDLE_LAYOUT_DIRECTORY, &pPlan->sczLayoutDirectory); 439 hr = VariableGetString(pVariables, BURN_BUNDLE_LAYOUT_DIRECTORY, &sczLayoutDirectory);
439 if (E_NOTFOUND == hr) // if not set, use the current directory as the layout directory. 440 if (E_NOTFOUND == hr) // if not set, use the current directory as the layout directory.
440 { 441 {
441 hr = VariableGetString(pVariables, BURN_BUNDLE_SOURCE_PROCESS_FOLDER, &pPlan->sczLayoutDirectory); 442 hr = VariableGetString(pVariables, BURN_BUNDLE_SOURCE_PROCESS_FOLDER, &sczLayoutDirectory);
442 if (E_NOTFOUND == hr) // if not set, use the current directory as the layout directory. 443 if (E_NOTFOUND == hr) // if not set, use the current directory as the layout directory.
443 { 444 {
444 hr = PathForCurrentProcess(&sczExecutablePath, NULL); 445 hr = PathForCurrentProcess(&sczExecutablePath, NULL);
445 ExitOnFailure(hr, "Failed to get path for current executing process as layout directory."); 446 ExitOnFailure(hr, "Failed to get path for current executing process as layout directory.");
446 447
447 hr = PathGetDirectory(sczExecutablePath, &pPlan->sczLayoutDirectory); 448 hr = PathGetDirectory(sczExecutablePath, &sczLayoutDirectory);
448 ExitOnFailure(hr, "Failed to get executing process as layout directory."); 449 ExitOnFailure(hr, "Failed to get executing process as layout directory.");
449 } 450 }
450 } 451 }
451 ExitOnFailure(hr, "Failed to get bundle layout directory property."); 452 ExitOnFailure(hr, "Failed to get bundle layout directory property.");
452 453
454 hr = PathGetFullPathName(sczLayoutDirectory, &pPlan->sczLayoutDirectory, NULL, NULL);
455 ExitOnFailure(hr, "Failed to ensure layout directory is fully qualified.");
456
453 hr = PathBackslashTerminate(&pPlan->sczLayoutDirectory); 457 hr = PathBackslashTerminate(&pPlan->sczLayoutDirectory);
454 ExitOnFailure(hr, "Failed to ensure layout directory is backslash terminated."); 458 ExitOnFailure(hr, "Failed to ensure layout directory is backslash terminated.");
455 459
@@ -478,6 +482,7 @@ extern "C" HRESULT PlanLayoutBundle(
478 482
479LExit: 483LExit:
480 ReleaseStr(sczExecutablePath); 484 ReleaseStr(sczExecutablePath);
485 ReleaseStr(sczLayoutDirectory);
481 486
482 return hr; 487 return hr;
483} 488}