@joebigelow / wix-1 / commits / abdde5b4

UX payloads are never external, part 2.

Sean Hall committed Apr 25, 2021 at 21:46 UTC abdde5b4193ecedadcc772f00ff314e1880475b6
4 files changed +5 -35
src/engine/cache.cpp
+2 -30
@@ -97,7 +97,6 @@ static HRESULT CopyEngineToWorkingFolder(
97 __in_z LPCWSTR wzSourcePath,
98 __in_z LPCWSTR wzWorkingFolderName,
99 __in_z LPCWSTR wzExecutableName,
100 - __in BURN_PAYLOADS* pUxPayloads,
100 __in BURN_SECTION* pSection,
101 __deref_out_z_opt LPWSTR* psczEngineWorkingPath
102 );
@@ -743,7 +742,6 @@ extern "C" BOOL CacheBundleRunningFromCache()
742 }
743
744 extern "C" HRESULT CacheBundleToCleanRoom(
746 - __in BURN_PAYLOADS* pUxPayloads,
745 __in BURN_SECTION* pSection,
746 __deref_out_z_opt LPWSTR* psczCleanRoomBundlePath
747 )
@@ -757,7 +755,7 @@ extern "C" HRESULT CacheBundleToCleanRoom(
755
756 wzExecutableName = PathFile(sczSourcePath);
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);
759 ExitOnFailure(hr, "Failed to cache bundle to clean room.");
760
761 LExit:
@@ -769,7 +767,6 @@ LExit:
767 extern "C" HRESULT CacheBundleToWorkingDirectory(
768 __in_z LPCWSTR /*wzBundleId*/,
769 __in_z LPCWSTR wzExecutableName,
772 - __in BURN_PAYLOADS* pUxPayloads,
770 __in BURN_SECTION* pSection,
771 __deref_out_z_opt LPWSTR* psczEngineWorkingPath
772 )
@@ -792,7 +789,7 @@ extern "C" HRESULT CacheBundleToWorkingDirectory(
789 }
790 else // otherwise, carry on putting the bundle in the working folder.
791 {
795 - hr = CopyEngineToWorkingFolder(sczSourcePath, BUNDLE_WORKING_FOLDER_NAME, wzExecutableName, pUxPayloads, pSection, psczEngineWorkingPath);
792 + hr = CopyEngineToWorkingFolder(sczSourcePath, BUNDLE_WORKING_FOLDER_NAME, wzExecutableName, pSection, psczEngineWorkingPath);
793 ExitOnFailure(hr, "Failed to copy engine to working folder.");
794 }
795
@@ -1767,7 +1764,6 @@ static HRESULT CopyEngineToWorkingFolder(
1764 __in_z LPCWSTR wzSourcePath,
1765 __in_z LPCWSTR wzWorkingFolderName,
1766 __in_z LPCWSTR wzExecutableName,
1770 - __in BURN_PAYLOADS* pUxPayloads,
1767 __in BURN_SECTION* pSection,
1768 __deref_out_z_opt LPWSTR* psczEngineWorkingPath
1769 )
@@ -1796,30 +1792,6 @@ static HRESULT CopyEngineToWorkingFolder(
1792 hr = CopyEngineWithSignatureFixup(pSection->hEngineFile, wzSourcePath, sczTargetPath, pSection);
1793 ExitOnFailure(hr, "Failed to copy engine: '%ls' to working path: %ls", wzSourcePath, sczTargetPath);
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 -
1795 if (psczEngineWorkingPath)
1796 {
1797 hr = StrAllocString(psczEngineWorkingPath, sczTargetPath, 0);
src/engine/cache.h
-2
@@ -124,14 +124,12 @@ void CacheSendErrorCallback(
124 );
125 BOOL CacheBundleRunningFromCache();
126 HRESULT CacheBundleToCleanRoom(
127 - __in BURN_PAYLOADS* pUxPayloads,
127 __in BURN_SECTION* pSection,
128 __deref_out_z_opt LPWSTR* psczCleanRoomBundlePath
129 );
130 HRESULT CacheBundleToWorkingDirectory(
131 __in_z LPCWSTR wzBundleId,
132 __in_z LPCWSTR wzExecutableName,
134 - __in BURN_PAYLOADS* pUxPayloads,
133 __in BURN_SECTION* pSection,
134 __deref_out_z_opt LPWSTR* psczEngineWorkingPath
135 );
src/engine/core.cpp
+2 -2
@@ -579,7 +579,7 @@ extern "C" HRESULT CoreElevate(
579 // If the elevated companion pipe isn't created yet, let's make that happen.
580 if (!pEngineState->sczBundleEngineWorkingPath)
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.");
584 }
585
@@ -678,7 +678,7 @@ extern "C" HRESULT CoreApply(
678 // Ensure the engine is cached to the working path.
679 if (!pEngineState->sczBundleEngineWorkingPath)
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.");
683 }
684
src/engine/engine.cpp
+1 -1
@@ -454,7 +454,7 @@ static HRESULT RunUntrusted(
454 }
455 else
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.");
459
460 wzCleanRoomBundlePath = sczCachedCleanRoomBundlePath;