aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-04-25 21:46:34 -0500
committerSean Hall <r.sean.hall@gmail.com>2021-04-25 22:58:23 -0500
commitabdde5b4193ecedadcc772f00ff314e1880475b6 (patch)
tree5dd2074a3abdd5ddada6b87825075a1915d3783e
parent666196071cf29d9b489e598a604ae0998c98b6de (diff)
downloadwix-abdde5b4193ecedadcc772f00ff314e1880475b6.tar.gz
wix-abdde5b4193ecedadcc772f00ff314e1880475b6.tar.bz2
wix-abdde5b4193ecedadcc772f00ff314e1880475b6.zip
UX payloads are never external, part 2.
-rw-r--r--src/engine/cache.cpp32
-rw-r--r--src/engine/cache.h2
-rw-r--r--src/engine/core.cpp4
-rw-r--r--src/engine/engine.cpp2
4 files changed, 5 insertions, 35 deletions
diff --git a/src/engine/cache.cpp b/src/engine/cache.cpp
index 2a40010d..fcc7f72d 100644
--- a/src/engine/cache.cpp
+++ b/src/engine/cache.cpp
@@ -97,7 +97,6 @@ static HRESULT CopyEngineToWorkingFolder(
97 __in_z LPCWSTR wzSourcePath, 97 __in_z LPCWSTR wzSourcePath,
98 __in_z LPCWSTR wzWorkingFolderName, 98 __in_z LPCWSTR wzWorkingFolderName,
99 __in_z LPCWSTR wzExecutableName, 99 __in_z LPCWSTR wzExecutableName,
100 __in BURN_PAYLOADS* pUxPayloads,
101 __in BURN_SECTION* pSection, 100 __in BURN_SECTION* pSection,
102 __deref_out_z_opt LPWSTR* psczEngineWorkingPath 101 __deref_out_z_opt LPWSTR* psczEngineWorkingPath
103 ); 102 );
@@ -743,7 +742,6 @@ extern "C" BOOL CacheBundleRunningFromCache()
743} 742}
744 743
745extern "C" HRESULT CacheBundleToCleanRoom( 744extern "C" HRESULT CacheBundleToCleanRoom(
746 __in BURN_PAYLOADS* pUxPayloads,
747 __in BURN_SECTION* pSection, 745 __in BURN_SECTION* pSection,
748 __deref_out_z_opt LPWSTR* psczCleanRoomBundlePath 746 __deref_out_z_opt LPWSTR* psczCleanRoomBundlePath
749 ) 747 )
@@ -757,7 +755,7 @@ extern "C" HRESULT CacheBundleToCleanRoom(
757 755
758 wzExecutableName = PathFile(sczSourcePath); 756 wzExecutableName = PathFile(sczSourcePath);
759 757
760 hr = CopyEngineToWorkingFolder(sczSourcePath, BUNDLE_CLEAN_ROOM_WORKING_FOLDER_NAME, wzExecutableName, pUxPayloads, pSection, psczCleanRoomBundlePath); 758 hr = CopyEngineToWorkingFolder(sczSourcePath, BUNDLE_CLEAN_ROOM_WORKING_FOLDER_NAME, wzExecutableName, pSection, psczCleanRoomBundlePath);
761 ExitOnFailure(hr, "Failed to cache bundle to clean room."); 759 ExitOnFailure(hr, "Failed to cache bundle to clean room.");
762 760
763LExit: 761LExit:
@@ -769,7 +767,6 @@ LExit:
769extern "C" HRESULT CacheBundleToWorkingDirectory( 767extern "C" HRESULT CacheBundleToWorkingDirectory(
770 __in_z LPCWSTR /*wzBundleId*/, 768 __in_z LPCWSTR /*wzBundleId*/,
771 __in_z LPCWSTR wzExecutableName, 769 __in_z LPCWSTR wzExecutableName,
772 __in BURN_PAYLOADS* pUxPayloads,
773 __in BURN_SECTION* pSection, 770 __in BURN_SECTION* pSection,
774 __deref_out_z_opt LPWSTR* psczEngineWorkingPath 771 __deref_out_z_opt LPWSTR* psczEngineWorkingPath
775 ) 772 )
@@ -792,7 +789,7 @@ extern "C" HRESULT CacheBundleToWorkingDirectory(
792 } 789 }
793 else // otherwise, carry on putting the bundle in the working folder. 790 else // otherwise, carry on putting the bundle in the working folder.
794 { 791 {
795 hr = CopyEngineToWorkingFolder(sczSourcePath, BUNDLE_WORKING_FOLDER_NAME, wzExecutableName, pUxPayloads, pSection, psczEngineWorkingPath); 792 hr = CopyEngineToWorkingFolder(sczSourcePath, BUNDLE_WORKING_FOLDER_NAME, wzExecutableName, pSection, psczEngineWorkingPath);
796 ExitOnFailure(hr, "Failed to copy engine to working folder."); 793 ExitOnFailure(hr, "Failed to copy engine to working folder.");
797 } 794 }
798 795
@@ -1767,7 +1764,6 @@ static HRESULT CopyEngineToWorkingFolder(
1767 __in_z LPCWSTR wzSourcePath, 1764 __in_z LPCWSTR wzSourcePath,
1768 __in_z LPCWSTR wzWorkingFolderName, 1765 __in_z LPCWSTR wzWorkingFolderName,
1769 __in_z LPCWSTR wzExecutableName, 1766 __in_z LPCWSTR wzExecutableName,
1770 __in BURN_PAYLOADS* pUxPayloads,
1771 __in BURN_SECTION* pSection, 1767 __in BURN_SECTION* pSection,
1772 __deref_out_z_opt LPWSTR* psczEngineWorkingPath 1768 __deref_out_z_opt LPWSTR* psczEngineWorkingPath
1773 ) 1769 )
@@ -1796,30 +1792,6 @@ static HRESULT CopyEngineToWorkingFolder(
1796 hr = CopyEngineWithSignatureFixup(pSection->hEngineFile, wzSourcePath, sczTargetPath, pSection); 1792 hr = CopyEngineWithSignatureFixup(pSection->hEngineFile, wzSourcePath, sczTargetPath, pSection);
1797 ExitOnFailure(hr, "Failed to copy engine: '%ls' to working path: %ls", wzSourcePath, sczTargetPath); 1793 ExitOnFailure(hr, "Failed to copy engine: '%ls' to working path: %ls", wzSourcePath, sczTargetPath);
1798 1794
1799 // Copy external UX payloads to working path.
1800 for (DWORD i = 0; i < pUxPayloads->cPayloads; ++i)
1801 {
1802 BURN_PAYLOAD* pPayload = &pUxPayloads->rgPayloads[i];
1803
1804 if (BURN_PAYLOAD_PACKAGING_EXTERNAL == pPayload->packaging)
1805 {
1806 if (!sczSourceDirectory)
1807 {
1808 hr = PathGetDirectory(wzSourcePath, &sczSourceDirectory);
1809 ExitOnFailure(hr, "Failed to get directory from engine path: %ls", wzSourcePath);
1810 }
1811
1812 hr = PathConcat(sczSourceDirectory, pPayload->sczSourcePath, &sczPayloadSourcePath);
1813 ExitOnFailure(hr, "Failed to build payload source path for working copy.");
1814
1815 hr = PathConcat(sczTargetDirectory, pPayload->sczFilePath, &sczPayloadTargetPath);
1816 ExitOnFailure(hr, "Failed to build payload target path for working copy.");
1817
1818 hr = FileEnsureCopyWithRetry(sczPayloadSourcePath, sczPayloadTargetPath, TRUE, FILE_OPERATION_RETRY_COUNT, FILE_OPERATION_RETRY_WAIT);
1819 ExitOnFailure(hr, "Failed to copy UX payload from: '%ls' to: '%ls'", sczPayloadSourcePath, sczPayloadTargetPath);
1820 }
1821 }
1822
1823 if (psczEngineWorkingPath) 1795 if (psczEngineWorkingPath)
1824 { 1796 {
1825 hr = StrAllocString(psczEngineWorkingPath, sczTargetPath, 0); 1797 hr = StrAllocString(psczEngineWorkingPath, sczTargetPath, 0);
diff --git a/src/engine/cache.h b/src/engine/cache.h
index a2ac1696..0152d33b 100644
--- a/src/engine/cache.h
+++ b/src/engine/cache.h
@@ -124,14 +124,12 @@ void CacheSendErrorCallback(
124 ); 124 );
125BOOL CacheBundleRunningFromCache(); 125BOOL CacheBundleRunningFromCache();
126HRESULT CacheBundleToCleanRoom( 126HRESULT CacheBundleToCleanRoom(
127 __in BURN_PAYLOADS* pUxPayloads,
128 __in BURN_SECTION* pSection, 127 __in BURN_SECTION* pSection,
129 __deref_out_z_opt LPWSTR* psczCleanRoomBundlePath 128 __deref_out_z_opt LPWSTR* psczCleanRoomBundlePath
130 ); 129 );
131HRESULT CacheBundleToWorkingDirectory( 130HRESULT CacheBundleToWorkingDirectory(
132 __in_z LPCWSTR wzBundleId, 131 __in_z LPCWSTR wzBundleId,
133 __in_z LPCWSTR wzExecutableName, 132 __in_z LPCWSTR wzExecutableName,
134 __in BURN_PAYLOADS* pUxPayloads,
135 __in BURN_SECTION* pSection, 133 __in BURN_SECTION* pSection,
136 __deref_out_z_opt LPWSTR* psczEngineWorkingPath 134 __deref_out_z_opt LPWSTR* psczEngineWorkingPath
137 ); 135 );
diff --git a/src/engine/core.cpp b/src/engine/core.cpp
index baba55f6..aea614d2 100644
--- a/src/engine/core.cpp
+++ b/src/engine/core.cpp
@@ -579,7 +579,7 @@ extern "C" HRESULT CoreElevate(
579 // If the elevated companion pipe isn't created yet, let's make that happen. 579 // If the elevated companion pipe isn't created yet, let's make that happen.
580 if (!pEngineState->sczBundleEngineWorkingPath) 580 if (!pEngineState->sczBundleEngineWorkingPath)
581 { 581 {
582 hr = CacheBundleToWorkingDirectory(pEngineState->registration.sczId, pEngineState->registration.sczExecutableName, &pEngineState->userExperience.payloads, &pEngineState->section, &pEngineState->sczBundleEngineWorkingPath); 582 hr = CacheBundleToWorkingDirectory(pEngineState->registration.sczId, pEngineState->registration.sczExecutableName, &pEngineState->section, &pEngineState->sczBundleEngineWorkingPath);
583 ExitOnFailure(hr, "Failed to cache engine to working directory."); 583 ExitOnFailure(hr, "Failed to cache engine to working directory.");
584 } 584 }
585 585
@@ -678,7 +678,7 @@ extern "C" HRESULT CoreApply(
678 // Ensure the engine is cached to the working path. 678 // Ensure the engine is cached to the working path.
679 if (!pEngineState->sczBundleEngineWorkingPath) 679 if (!pEngineState->sczBundleEngineWorkingPath)
680 { 680 {
681 hr = CacheBundleToWorkingDirectory(pEngineState->registration.sczId, pEngineState->registration.sczExecutableName, &pEngineState->userExperience.payloads, &pEngineState->section, &pEngineState->sczBundleEngineWorkingPath); 681 hr = CacheBundleToWorkingDirectory(pEngineState->registration.sczId, pEngineState->registration.sczExecutableName, &pEngineState->section, &pEngineState->sczBundleEngineWorkingPath);
682 ExitOnFailure(hr, "Failed to cache engine to working directory."); 682 ExitOnFailure(hr, "Failed to cache engine to working directory.");
683 } 683 }
684 684
diff --git a/src/engine/engine.cpp b/src/engine/engine.cpp
index 458386d4..bb4061a7 100644
--- a/src/engine/engine.cpp
+++ b/src/engine/engine.cpp
@@ -454,7 +454,7 @@ static HRESULT RunUntrusted(
454 } 454 }
455 else 455 else
456 { 456 {
457 hr = CacheBundleToCleanRoom(&pEngineState->userExperience.payloads, &pEngineState->section, &sczCachedCleanRoomBundlePath); 457 hr = CacheBundleToCleanRoom(&pEngineState->section, &sczCachedCleanRoomBundlePath);
458 ExitOnFailure(hr, "Failed to cache to clean room."); 458 ExitOnFailure(hr, "Failed to cache to clean room.");
459 459
460 wzCleanRoomBundlePath = sczCachedCleanRoomBundlePath; 460 wzCleanRoomBundlePath = sczCachedCleanRoomBundlePath;