diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2020-05-14 19:59:06 +1000 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2020-05-16 21:42:51 +1000 |
commit | 50cb451bcee148afd9768086c1bb5ed4f75562df (patch) | |
tree | b4a28ef01446f2afd02b803af28ee6c628816cee | |
parent | d232c5621fe336b1f563b69be7637c93e795e151 (diff) | |
download | wix-50cb451bcee148afd9768086c1bb5ed4f75562df.tar.gz wix-50cb451bcee148afd9768086c1bb5ed4f75562df.tar.bz2 wix-50cb451bcee148afd9768086c1bb5ed4f75562df.zip |
WIXFEAT:6164 Give BA control over UI level and handler.
-rw-r--r-- | src/engine/apply.cpp | 8 | ||||
-rw-r--r-- | src/engine/core.cpp | 8 | ||||
-rw-r--r-- | src/engine/elevation.cpp | 24 | ||||
-rw-r--r-- | src/engine/engine.vcxproj | 8 | ||||
-rw-r--r-- | src/engine/msiengine.cpp | 117 | ||||
-rw-r--r-- | src/engine/msiengine.h | 18 | ||||
-rw-r--r-- | src/engine/mspengine.cpp | 38 | ||||
-rw-r--r-- | src/engine/mspengine.h | 2 | ||||
-rw-r--r-- | src/engine/package.h | 2 | ||||
-rw-r--r-- | src/engine/packages.config | 4 | ||||
-rw-r--r-- | src/engine/plan.cpp | 24 | ||||
-rw-r--r-- | src/engine/plan.h | 8 | ||||
-rw-r--r-- | src/engine/userexperience.cpp | 47 | ||||
-rw-r--r-- | src/engine/userexperience.h | 13 | ||||
-rw-r--r-- | src/stub/packages.config | 2 | ||||
-rw-r--r-- | src/stub/stub.vcxproj | 4 |
16 files changed, 237 insertions, 90 deletions
diff --git a/src/engine/apply.cpp b/src/engine/apply.cpp index ee11cdee..eae7c681 100644 --- a/src/engine/apply.cpp +++ b/src/engine/apply.cpp | |||
@@ -2064,7 +2064,7 @@ static HRESULT ExecuteExePackage( | |||
2064 | fBeginCalled = TRUE; | 2064 | fBeginCalled = TRUE; |
2065 | 2065 | ||
2066 | // Send package execute begin to BA. | 2066 | // Send package execute begin to BA. |
2067 | hr = UserExperienceOnExecutePackageBegin(&pEngineState->userExperience, pExecuteAction->exePackage.pPackage->sczId, !fRollback, pExecuteAction->exePackage.action); | 2067 | hr = UserExperienceOnExecutePackageBegin(&pEngineState->userExperience, pExecuteAction->exePackage.pPackage->sczId, !fRollback, pExecuteAction->exePackage.action, INSTALLUILEVEL_NOCHANGE, false); |
2068 | ExitOnRootFailure(hr, "BA aborted execute EXE package begin."); | 2068 | ExitOnRootFailure(hr, "BA aborted execute EXE package begin."); |
2069 | 2069 | ||
2070 | message.type = GENERIC_EXECUTE_MESSAGE_PROGRESS; | 2070 | message.type = GENERIC_EXECUTE_MESSAGE_PROGRESS; |
@@ -2133,7 +2133,7 @@ static HRESULT ExecuteMsiPackage( | |||
2133 | fBeginCalled = TRUE; | 2133 | fBeginCalled = TRUE; |
2134 | 2134 | ||
2135 | // Send package execute begin to BA. | 2135 | // Send package execute begin to BA. |
2136 | hr = UserExperienceOnExecutePackageBegin(&pEngineState->userExperience, pExecuteAction->msiPackage.pPackage->sczId, !fRollback, pExecuteAction->msiPackage.action); | 2136 | hr = UserExperienceOnExecutePackageBegin(&pEngineState->userExperience, pExecuteAction->msiPackage.pPackage->sczId, !fRollback, pExecuteAction->msiPackage.action, pExecuteAction->msiPackage.uiLevel, pExecuteAction->msiPackage.fDisableExternalUiHandler); |
2137 | ExitOnRootFailure(hr, "BA aborted execute MSI package begin."); | 2137 | ExitOnRootFailure(hr, "BA aborted execute MSI package begin."); |
2138 | 2138 | ||
2139 | // execute package | 2139 | // execute package |
@@ -2188,7 +2188,7 @@ static HRESULT ExecuteMspPackage( | |||
2188 | fBeginCalled = TRUE; | 2188 | fBeginCalled = TRUE; |
2189 | 2189 | ||
2190 | // Send package execute begin to BA. | 2190 | // Send package execute begin to BA. |
2191 | hr = UserExperienceOnExecutePackageBegin(&pEngineState->userExperience, pExecuteAction->mspTarget.pPackage->sczId, !fRollback, pExecuteAction->mspTarget.action); | 2191 | hr = UserExperienceOnExecutePackageBegin(&pEngineState->userExperience, pExecuteAction->mspTarget.pPackage->sczId, !fRollback, pExecuteAction->mspTarget.action, pExecuteAction->mspTarget.uiLevel, pExecuteAction->mspTarget.fDisableExternalUiHandler); |
2192 | ExitOnRootFailure(hr, "BA aborted execute MSP package begin."); | 2192 | ExitOnRootFailure(hr, "BA aborted execute MSP package begin."); |
2193 | 2193 | ||
2194 | // Now send all the patches that target this product code. | 2194 | // Now send all the patches that target this product code. |
@@ -2255,7 +2255,7 @@ static HRESULT ExecuteMsuPackage( | |||
2255 | fBeginCalled = TRUE; | 2255 | fBeginCalled = TRUE; |
2256 | 2256 | ||
2257 | // Send package execute begin to BA. | 2257 | // Send package execute begin to BA. |
2258 | hr = UserExperienceOnExecutePackageBegin(&pEngineState->userExperience, pExecuteAction->msuPackage.pPackage->sczId, !fRollback, pExecuteAction->msuPackage.action); | 2258 | hr = UserExperienceOnExecutePackageBegin(&pEngineState->userExperience, pExecuteAction->msuPackage.pPackage->sczId, !fRollback, pExecuteAction->msuPackage.action, INSTALLUILEVEL_NOCHANGE, false); |
2259 | ExitOnRootFailure(hr, "BA aborted execute MSU package begin."); | 2259 | ExitOnRootFailure(hr, "BA aborted execute MSU package begin."); |
2260 | 2260 | ||
2261 | message.type = GENERIC_EXECUTE_MESSAGE_PROGRESS; | 2261 | message.type = GENERIC_EXECUTE_MESSAGE_PROGRESS; |
diff --git a/src/engine/core.cpp b/src/engine/core.cpp index 26e74588..c153f162 100644 --- a/src/engine/core.cpp +++ b/src/engine/core.cpp | |||
@@ -431,7 +431,7 @@ extern "C" HRESULT CorePlan( | |||
431 | ExitOnFailure(hr, "Failed to plan the layout of the bundle."); | 431 | ExitOnFailure(hr, "Failed to plan the layout of the bundle."); |
432 | 432 | ||
433 | // Plan the packages' layout. | 433 | // Plan the packages' layout. |
434 | hr = PlanPackages(&pEngineState->registration, &pEngineState->userExperience, &pEngineState->packages, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, FALSE, pEngineState->command.display, pEngineState->command.relationType, sczLayoutDirectory, &hSyncpointEvent); | 434 | hr = PlanPackages(&pEngineState->registration, &pEngineState->userExperience, &pEngineState->packages, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, FALSE, pEngineState->command.relationType, sczLayoutDirectory, &hSyncpointEvent); |
435 | ExitOnFailure(hr, "Failed to plan packages."); | 435 | ExitOnFailure(hr, "Failed to plan packages."); |
436 | } | 436 | } |
437 | else if (BOOTSTRAPPER_ACTION_UPDATE_REPLACE == action || BOOTSTRAPPER_ACTION_UPDATE_REPLACE_EMBEDDED == action) | 437 | else if (BOOTSTRAPPER_ACTION_UPDATE_REPLACE == action || BOOTSTRAPPER_ACTION_UPDATE_REPLACE_EMBEDDED == action) |
@@ -440,7 +440,7 @@ extern "C" HRESULT CorePlan( | |||
440 | 440 | ||
441 | pUpgradeBundlePackage = &pEngineState->update.package; | 441 | pUpgradeBundlePackage = &pEngineState->update.package; |
442 | 442 | ||
443 | hr = PlanUpdateBundle(&pEngineState->userExperience, pUpgradeBundlePackage, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.display, pEngineState->command.relationType, &hSyncpointEvent); | 443 | hr = PlanUpdateBundle(&pEngineState->userExperience, pUpgradeBundlePackage, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.relationType, &hSyncpointEvent); |
444 | ExitOnFailure(hr, "Failed to plan update."); | 444 | ExitOnFailure(hr, "Failed to plan update."); |
445 | } | 445 | } |
446 | else if (pEngineState->registration.fEnabledForwardCompatibleBundle) | 446 | else if (pEngineState->registration.fEnabledForwardCompatibleBundle) |
@@ -449,7 +449,7 @@ extern "C" HRESULT CorePlan( | |||
449 | 449 | ||
450 | pForwardCompatibleBundlePackage = &pEngineState->registration.forwardCompatibleBundle; | 450 | pForwardCompatibleBundlePackage = &pEngineState->registration.forwardCompatibleBundle; |
451 | 451 | ||
452 | hr = PlanPassThroughBundle(&pEngineState->userExperience, pForwardCompatibleBundlePackage, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.display, pEngineState->command.relationType, &hSyncpointEvent); | 452 | hr = PlanPassThroughBundle(&pEngineState->userExperience, pForwardCompatibleBundlePackage, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->command.relationType, &hSyncpointEvent); |
453 | ExitOnFailure(hr, "Failed to plan passthrough."); | 453 | ExitOnFailure(hr, "Failed to plan passthrough."); |
454 | } | 454 | } |
455 | else // doing an action that modifies the machine state. | 455 | else // doing an action that modifies the machine state. |
@@ -471,7 +471,7 @@ extern "C" HRESULT CorePlan( | |||
471 | hr = PlanRelatedBundlesBegin(&pEngineState->userExperience, &pEngineState->registration, pEngineState->command.relationType, &pEngineState->plan); | 471 | hr = PlanRelatedBundlesBegin(&pEngineState->userExperience, &pEngineState->registration, pEngineState->command.relationType, &pEngineState->plan); |
472 | ExitOnFailure(hr, "Failed to plan related bundles."); | 472 | ExitOnFailure(hr, "Failed to plan related bundles."); |
473 | 473 | ||
474 | hr = PlanPackages(&pEngineState->registration, &pEngineState->userExperience, &pEngineState->packages, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->registration.fInstalled, pEngineState->command.display, pEngineState->command.relationType, NULL, &hSyncpointEvent); | 474 | hr = PlanPackages(&pEngineState->registration, &pEngineState->userExperience, &pEngineState->packages, &pEngineState->plan, &pEngineState->log, &pEngineState->variables, pEngineState->registration.fInstalled, pEngineState->command.relationType, NULL, &hSyncpointEvent); |
475 | ExitOnFailure(hr, "Failed to plan packages."); | 475 | ExitOnFailure(hr, "Failed to plan packages."); |
476 | 476 | ||
477 | // Schedule the update of related bundles last. | 477 | // Schedule the update of related bundles last. |
diff --git a/src/engine/elevation.cpp b/src/engine/elevation.cpp index 0b96c300..d0652270 100644 --- a/src/engine/elevation.cpp +++ b/src/engine/elevation.cpp | |||
@@ -821,9 +821,15 @@ extern "C" HRESULT ElevationExecuteMsiPackage( | |||
821 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->msiPackage.sczLogPath); | 821 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->msiPackage.sczLogPath); |
822 | ExitOnFailure(hr, "Failed to write package log to message buffer."); | 822 | ExitOnFailure(hr, "Failed to write package log to message buffer."); |
823 | 823 | ||
824 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)pExecuteAction->msiPackage.actionMsiProperty); | ||
825 | ExitOnFailure(hr, "Failed to write actionMsiProperty to message buffer."); | ||
826 | |||
824 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)pExecuteAction->msiPackage.uiLevel); | 827 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)pExecuteAction->msiPackage.uiLevel); |
825 | ExitOnFailure(hr, "Failed to write UI level to message buffer."); | 828 | ExitOnFailure(hr, "Failed to write UI level to message buffer."); |
826 | 829 | ||
830 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)pExecuteAction->msiPackage.fDisableExternalUiHandler); | ||
831 | ExitOnFailure(hr, "Failed to write fDisableExternalUiHandler to message buffer."); | ||
832 | |||
827 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)pExecuteAction->msiPackage.action); | 833 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)pExecuteAction->msiPackage.action); |
828 | ExitOnFailure(hr, "Failed to write action to message buffer."); | 834 | ExitOnFailure(hr, "Failed to write action to message buffer."); |
829 | 835 | ||
@@ -897,9 +903,15 @@ extern "C" HRESULT ElevationExecuteMspPackage( | |||
897 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->mspTarget.sczLogPath); | 903 | hr = BuffWriteString(&pbData, &cbData, pExecuteAction->mspTarget.sczLogPath); |
898 | ExitOnFailure(hr, "Failed to write package log to message buffer."); | 904 | ExitOnFailure(hr, "Failed to write package log to message buffer."); |
899 | 905 | ||
906 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)pExecuteAction->mspTarget.actionMsiProperty); | ||
907 | ExitOnFailure(hr, "Failed to write actionMsiProperty to message buffer."); | ||
908 | |||
900 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)pExecuteAction->mspTarget.uiLevel); | 909 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)pExecuteAction->mspTarget.uiLevel); |
901 | ExitOnFailure(hr, "Failed to write UI level to message buffer."); | 910 | ExitOnFailure(hr, "Failed to write UI level to message buffer."); |
902 | 911 | ||
912 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)pExecuteAction->mspTarget.fDisableExternalUiHandler); | ||
913 | ExitOnFailure(hr, "Failed to write fDisableExternalUiHandler to message buffer."); | ||
914 | |||
903 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)pExecuteAction->mspTarget.action); | 915 | hr = BuffWriteNumber(&pbData, &cbData, (DWORD)pExecuteAction->mspTarget.action); |
904 | ExitOnFailure(hr, "Failed to write action to message buffer."); | 916 | ExitOnFailure(hr, "Failed to write action to message buffer."); |
905 | 917 | ||
@@ -2237,9 +2249,15 @@ static HRESULT OnExecuteMsiPackage( | |||
2237 | hr = BuffReadString(pbData, cbData, &iData, &executeAction.msiPackage.sczLogPath); | 2249 | hr = BuffReadString(pbData, cbData, &iData, &executeAction.msiPackage.sczLogPath); |
2238 | ExitOnFailure(hr, "Failed to read package log."); | 2250 | ExitOnFailure(hr, "Failed to read package log."); |
2239 | 2251 | ||
2252 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&executeAction.msiPackage.actionMsiProperty); | ||
2253 | ExitOnFailure(hr, "Failed to read actionMsiProperty."); | ||
2254 | |||
2240 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&executeAction.msiPackage.uiLevel); | 2255 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&executeAction.msiPackage.uiLevel); |
2241 | ExitOnFailure(hr, "Failed to read UI level."); | 2256 | ExitOnFailure(hr, "Failed to read UI level."); |
2242 | 2257 | ||
2258 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&executeAction.msiPackage.fDisableExternalUiHandler); | ||
2259 | ExitOnFailure(hr, "Failed to read fDisableExternalUiHandler."); | ||
2260 | |||
2243 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&executeAction.msiPackage.action); | 2261 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&executeAction.msiPackage.action); |
2244 | ExitOnFailure(hr, "Failed to read action."); | 2262 | ExitOnFailure(hr, "Failed to read action."); |
2245 | 2263 | ||
@@ -2334,9 +2352,15 @@ static HRESULT OnExecuteMspPackage( | |||
2334 | hr = BuffReadString(pbData, cbData, &iData, &executeAction.mspTarget.sczLogPath); | 2352 | hr = BuffReadString(pbData, cbData, &iData, &executeAction.mspTarget.sczLogPath); |
2335 | ExitOnFailure(hr, "Failed to read package log."); | 2353 | ExitOnFailure(hr, "Failed to read package log."); |
2336 | 2354 | ||
2355 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&executeAction.mspTarget.actionMsiProperty); | ||
2356 | ExitOnFailure(hr, "Failed to read actionMsiProperty."); | ||
2357 | |||
2337 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&executeAction.mspTarget.uiLevel); | 2358 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&executeAction.mspTarget.uiLevel); |
2338 | ExitOnFailure(hr, "Failed to read UI level."); | 2359 | ExitOnFailure(hr, "Failed to read UI level."); |
2339 | 2360 | ||
2361 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&executeAction.mspTarget.fDisableExternalUiHandler); | ||
2362 | ExitOnFailure(hr, "Failed to read fDisableExternalUiHandler."); | ||
2363 | |||
2340 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&executeAction.mspTarget.action); | 2364 | hr = BuffReadNumber(pbData, cbData, &iData, (DWORD*)&executeAction.mspTarget.action); |
2341 | ExitOnFailure(hr, "Failed to read action."); | 2365 | ExitOnFailure(hr, "Failed to read action."); |
2342 | 2366 | ||
diff --git a/src/engine/engine.vcxproj b/src/engine/engine.vcxproj index 6fd9d64a..80b67b7d 100644 --- a/src/engine/engine.vcxproj +++ b/src/engine/engine.vcxproj | |||
@@ -2,8 +2,8 @@ | |||
2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | 2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> |
3 | 3 | ||
4 | <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | 4 | <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
5 | <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.15\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.15\build\WixToolset.BootstrapperCore.Native.props')" /> | 5 | <Import Project="..\..\packages\WixToolset.BootstrapperCore.Native.4.0.16\build\WixToolset.BootstrapperCore.Native.props" Condition="Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.16\build\WixToolset.BootstrapperCore.Native.props')" /> |
6 | <Import Project="..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props')" /> | 6 | <Import Project="..\..\packages\WixToolset.DUtil.4.0.23\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.23\build\WixToolset.DUtil.props')" /> |
7 | 7 | ||
8 | <ItemGroup Label="ProjectConfigurations"> | 8 | <ItemGroup Label="ProjectConfigurations"> |
9 | <ProjectConfiguration Include="Debug|Win32"> | 9 | <ProjectConfiguration Include="Debug|Win32"> |
@@ -166,8 +166,8 @@ rc.exe -fo "$(OutDir)engine.res" "$(IntDir)engine.messages.rc"</Command> | |||
166 | <PropertyGroup> | 166 | <PropertyGroup> |
167 | <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> | 167 | <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> |
168 | </PropertyGroup> | 168 | </PropertyGroup> |
169 | <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.15\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.15\build\WixToolset.BootstrapperCore.Native.props'))" /> | 169 | <Error Condition="!Exists('..\..\packages\WixToolset.BootstrapperCore.Native.4.0.16\build\WixToolset.BootstrapperCore.Native.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.BootstrapperCore.Native.4.0.16\build\WixToolset.BootstrapperCore.Native.props'))" /> |
170 | <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props'))" /> | 170 | <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.23\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.23\build\WixToolset.DUtil.props'))" /> |
171 | <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" /> | 171 | <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" /> |
172 | </Target> | 172 | </Target> |
173 | </Project> | 173 | </Project> |
diff --git a/src/engine/msiengine.cpp b/src/engine/msiengine.cpp index 17571ac5..3f89dde9 100644 --- a/src/engine/msiengine.cpp +++ b/src/engine/msiengine.cpp | |||
@@ -4,7 +4,10 @@ | |||
4 | 4 | ||
5 | 5 | ||
6 | // constants | 6 | // constants |
7 | 7 | #define BURNMSIINSTALL_PROPERTY_NAME L"BURNMSIINSTALL" | |
8 | #define BURNMSIMODIFY_PROPERTY_NAME L"BURNMSIMODIFY" | ||
9 | #define BURNMSIREPAIR_PROPERTY_NAME L"BURNMSIREPAIR" | ||
10 | #define BURNMSIUNINSTALL_PROPERTY_NAME L"BURNMSIUNINSTALL" | ||
8 | 11 | ||
9 | // structs | 12 | // structs |
10 | 13 | ||
@@ -79,10 +82,6 @@ extern "C" HRESULT MsiEngineParsePackageFromXml( | |||
79 | hr = FileVersionFromStringEx(scz, 0, &pPackage->Msi.qwVersion); | 82 | hr = FileVersionFromStringEx(scz, 0, &pPackage->Msi.qwVersion); |
80 | ExitOnFailure(hr, "Failed to parse @Version: %ls", scz); | 83 | ExitOnFailure(hr, "Failed to parse @Version: %ls", scz); |
81 | 84 | ||
82 | // @DisplayInternalUI | ||
83 | hr = XmlGetYesNoAttribute(pixnMsiPackage, L"DisplayInternalUI", &pPackage->Msi.fDisplayInternalUI); | ||
84 | ExitOnFailure(hr, "Failed to get @DisplayInternalUI."); | ||
85 | |||
86 | // @UpgradeCode | 85 | // @UpgradeCode |
87 | hr = XmlGetAttributeEx(pixnMsiPackage, L"UpgradeCode", &pPackage->Msi.sczUpgradeCode); | 86 | hr = XmlGetAttributeEx(pixnMsiPackage, L"UpgradeCode", &pPackage->Msi.sczUpgradeCode); |
88 | if (E_NOTFOUND != hr) | 87 | if (E_NOTFOUND != hr) |
@@ -874,7 +873,7 @@ LExit: | |||
874 | // PlanAdd - adds the calculated execute and rollback actions for the package. | 873 | // PlanAdd - adds the calculated execute and rollback actions for the package. |
875 | // | 874 | // |
876 | extern "C" HRESULT MsiEnginePlanAddPackage( | 875 | extern "C" HRESULT MsiEnginePlanAddPackage( |
877 | __in BOOTSTRAPPER_DISPLAY display, | 876 | __in BURN_USER_EXPERIENCE* pUserExperience, |
878 | __in BURN_PACKAGE* pPackage, | 877 | __in BURN_PACKAGE* pPackage, |
879 | __in BURN_PLAN* pPlan, | 878 | __in BURN_PLAN* pPlan, |
880 | __in BURN_LOGGING* pLog, | 879 | __in BURN_LOGGING* pLog, |
@@ -926,10 +925,13 @@ extern "C" HRESULT MsiEnginePlanAddPackage( | |||
926 | pAction->type = BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE; | 925 | pAction->type = BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE; |
927 | pAction->msiPackage.pPackage = pPackage; | 926 | pAction->msiPackage.pPackage = pPackage; |
928 | pAction->msiPackage.action = pPackage->rollback; | 927 | pAction->msiPackage.action = pPackage->rollback; |
929 | pAction->msiPackage.uiLevel = MsiEngineCalculateInstallUiLevel(pPackage->Msi.fDisplayInternalUI, display, pAction->msiPackage.action); | ||
930 | pAction->msiPackage.rgFeatures = rgRollbackFeatureActions; | 928 | pAction->msiPackage.rgFeatures = rgRollbackFeatureActions; |
931 | rgRollbackFeatureActions = NULL; | 929 | rgRollbackFeatureActions = NULL; |
932 | 930 | ||
931 | hr = MsiEngineCalculateInstallUiLevel(pUserExperience, pPackage->sczId, FALSE, pAction->msiPackage.action, | ||
932 | &pAction->msiPackage.actionMsiProperty, &pAction->msiPackage.uiLevel, &pAction->msiPackage.fDisableExternalUiHandler); | ||
933 | ExitOnFailure(hr, "Failed to get msi ui options."); | ||
934 | |||
933 | LoggingSetPackageVariable(pPackage, NULL, TRUE, pLog, pVariables, &pAction->msiPackage.sczLogPath); // ignore errors. | 935 | LoggingSetPackageVariable(pPackage, NULL, TRUE, pLog, pVariables, &pAction->msiPackage.sczLogPath); // ignore errors. |
934 | pAction->msiPackage.dwLoggingAttributes = pLog->dwAttributes; | 936 | pAction->msiPackage.dwLoggingAttributes = pLog->dwAttributes; |
935 | 937 | ||
@@ -949,10 +951,13 @@ extern "C" HRESULT MsiEnginePlanAddPackage( | |||
949 | pAction->type = BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE; | 951 | pAction->type = BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE; |
950 | pAction->msiPackage.pPackage = pPackage; | 952 | pAction->msiPackage.pPackage = pPackage; |
951 | pAction->msiPackage.action = pPackage->execute; | 953 | pAction->msiPackage.action = pPackage->execute; |
952 | pAction->msiPackage.uiLevel = MsiEngineCalculateInstallUiLevel(pPackage->Msi.fDisplayInternalUI, display, pAction->msiPackage.action); | ||
953 | pAction->msiPackage.rgFeatures = rgFeatureActions; | 954 | pAction->msiPackage.rgFeatures = rgFeatureActions; |
954 | rgFeatureActions = NULL; | 955 | rgFeatureActions = NULL; |
955 | 956 | ||
957 | hr = MsiEngineCalculateInstallUiLevel(pUserExperience, pPackage->sczId, TRUE, pAction->msiPackage.action, | ||
958 | &pAction->msiPackage.actionMsiProperty, &pAction->msiPackage.uiLevel, &pAction->msiPackage.fDisableExternalUiHandler); | ||
959 | ExitOnFailure(hr, "Failed to get msi ui options."); | ||
960 | |||
956 | LoggingSetPackageVariable(pPackage, NULL, FALSE, pLog, pVariables, &pAction->msiPackage.sczLogPath); // ignore errors. | 961 | LoggingSetPackageVariable(pPackage, NULL, FALSE, pLog, pVariables, &pAction->msiPackage.sczLogPath); // ignore errors. |
957 | pAction->msiPackage.dwLoggingAttributes = pLog->dwAttributes; | 962 | pAction->msiPackage.dwLoggingAttributes = pLog->dwAttributes; |
958 | } | 963 | } |
@@ -1073,7 +1078,6 @@ extern "C" HRESULT MsiEngineAddCompatiblePackage( | |||
1073 | } | 1078 | } |
1074 | 1079 | ||
1075 | pCompatiblePackage->type = BURN_PACKAGE_TYPE_MSI; | 1080 | pCompatiblePackage->type = BURN_PACKAGE_TYPE_MSI; |
1076 | pCompatiblePackage->Msi.fDisplayInternalUI = pPackage->Msi.fDisplayInternalUI; | ||
1077 | 1081 | ||
1078 | if (ppCompatiblePackage) | 1082 | if (ppCompatiblePackage) |
1079 | { | 1083 | { |
@@ -1161,8 +1165,16 @@ extern "C" HRESULT MsiEngineExecutePackage( | |||
1161 | VariableSetNumeric(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_ACTION, pExecuteAction->msiPackage.action, TRUE); | 1165 | VariableSetNumeric(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_ACTION, pExecuteAction->msiPackage.action, TRUE); |
1162 | 1166 | ||
1163 | // Wire up the external UI handler and logging. | 1167 | // Wire up the external UI handler and logging. |
1164 | hr = WiuInitializeExternalUI(pfnMessageHandler, pExecuteAction->msiPackage.uiLevel, hwndParent, pvContext, fRollback, &context); | 1168 | if (pExecuteAction->msiPackage.fDisableExternalUiHandler) |
1165 | ExitOnFailure(hr, "Failed to initialize external UI handler."); | 1169 | { |
1170 | hr = WiuInitializeInternalUI(pExecuteAction->msiPackage.uiLevel, hwndParent, &context); | ||
1171 | ExitOnFailure(hr, "Failed to initialize internal UI for MSI package."); | ||
1172 | } | ||
1173 | else | ||
1174 | { | ||
1175 | hr = WiuInitializeExternalUI(pfnMessageHandler, pExecuteAction->msiPackage.uiLevel, hwndParent, pvContext, fRollback, &context); | ||
1176 | ExitOnFailure(hr, "Failed to initialize external UI handler."); | ||
1177 | } | ||
1166 | 1178 | ||
1167 | if (pExecuteAction->msiPackage.sczLogPath && *pExecuteAction->msiPackage.sczLogPath) | 1179 | if (pExecuteAction->msiPackage.sczLogPath && *pExecuteAction->msiPackage.sczLogPath) |
1168 | { | 1180 | { |
@@ -1191,6 +1203,12 @@ extern "C" HRESULT MsiEngineExecutePackage( | |||
1191 | hr = ConcatPatchProperty(pExecuteAction->msiPackage.pPackage, pExecuteAction->msiPackage.rgSlipstreamPatches, &sczObfuscatedProperties); | 1203 | hr = ConcatPatchProperty(pExecuteAction->msiPackage.pPackage, pExecuteAction->msiPackage.rgSlipstreamPatches, &sczObfuscatedProperties); |
1192 | ExitOnFailure(hr, "Failed to add patch properties to obfuscated argument string."); | 1204 | ExitOnFailure(hr, "Failed to add patch properties to obfuscated argument string."); |
1193 | 1205 | ||
1206 | hr = MsiEngineConcatActionProperty(pExecuteAction->msiPackage.actionMsiProperty, &sczProperties); | ||
1207 | ExitOnFailure(hr, "Failed to add action property to argument string."); | ||
1208 | |||
1209 | hr = MsiEngineConcatActionProperty(pExecuteAction->msiPackage.actionMsiProperty, &sczObfuscatedProperties); | ||
1210 | ExitOnFailure(hr, "Failed to add action property to obfuscated argument string."); | ||
1211 | |||
1194 | LogId(REPORT_STANDARD, MSG_APPLYING_PACKAGE, LoggingRollbackOrExecute(fRollback), pExecuteAction->msiPackage.pPackage->sczId, LoggingActionStateToString(pExecuteAction->msiPackage.action), sczMsiPath, sczObfuscatedProperties ? sczObfuscatedProperties : L""); | 1212 | LogId(REPORT_STANDARD, MSG_APPLYING_PACKAGE, LoggingRollbackOrExecute(fRollback), pExecuteAction->msiPackage.pPackage->sczId, LoggingActionStateToString(pExecuteAction->msiPackage.action), sczMsiPath, sczObfuscatedProperties ? sczObfuscatedProperties : L""); |
1195 | 1213 | ||
1196 | // | 1214 | // |
@@ -1300,6 +1318,40 @@ LExit: | |||
1300 | return hr; | 1318 | return hr; |
1301 | } | 1319 | } |
1302 | 1320 | ||
1321 | extern "C" HRESULT MsiEngineConcatActionProperty( | ||
1322 | __in BURN_MSI_PROPERTY actionMsiProperty, | ||
1323 | __deref_out_z LPWSTR* psczProperties | ||
1324 | ) | ||
1325 | { | ||
1326 | HRESULT hr = S_OK; | ||
1327 | LPCWSTR wzPropertyName = NULL; | ||
1328 | |||
1329 | switch (actionMsiProperty) | ||
1330 | { | ||
1331 | case BURN_MSI_PROPERTY_INSTALL: | ||
1332 | wzPropertyName = BURNMSIINSTALL_PROPERTY_NAME; | ||
1333 | break; | ||
1334 | case BURN_MSI_PROPERTY_MODIFY: | ||
1335 | wzPropertyName = BURNMSIMODIFY_PROPERTY_NAME; | ||
1336 | break; | ||
1337 | case BURN_MSI_PROPERTY_REPAIR: | ||
1338 | wzPropertyName = BURNMSIREPAIR_PROPERTY_NAME; | ||
1339 | break; | ||
1340 | case BURN_MSI_PROPERTY_UNINSTALL: | ||
1341 | wzPropertyName = BURNMSIUNINSTALL_PROPERTY_NAME; | ||
1342 | break; | ||
1343 | } | ||
1344 | |||
1345 | if (wzPropertyName) | ||
1346 | { | ||
1347 | hr = StrAllocConcatFormattedSecure(psczProperties, L" %ls=1", wzPropertyName); | ||
1348 | ExitOnFailure(hr, "Failed to add burn action property."); | ||
1349 | } | ||
1350 | |||
1351 | LExit: | ||
1352 | return hr; | ||
1353 | } | ||
1354 | |||
1303 | // The contents of psczProperties may be sensitive, should keep encrypted and SecureZeroFree. | 1355 | // The contents of psczProperties may be sensitive, should keep encrypted and SecureZeroFree. |
1304 | extern "C" HRESULT MsiEngineConcatProperties( | 1356 | extern "C" HRESULT MsiEngineConcatProperties( |
1305 | __in_ecount(cProperties) BURN_MSIPROPERTY* rgProperties, | 1357 | __in_ecount(cProperties) BURN_MSIPROPERTY* rgProperties, |
@@ -1363,31 +1415,36 @@ LExit: | |||
1363 | return hr; | 1415 | return hr; |
1364 | } | 1416 | } |
1365 | 1417 | ||
1366 | extern "C" INSTALLUILEVEL MsiEngineCalculateInstallUiLevel( | 1418 | extern "C" HRESULT MsiEngineCalculateInstallUiLevel( |
1367 | __in BOOL fDisplayInternalUI, | 1419 | __in BURN_USER_EXPERIENCE* pUserExperience, |
1368 | __in BOOTSTRAPPER_DISPLAY display, | 1420 | __in LPCWSTR wzPackageId, |
1369 | __in BOOTSTRAPPER_ACTION_STATE actionState | 1421 | __in BOOL fExecute, |
1422 | __in BOOTSTRAPPER_ACTION_STATE actionState, | ||
1423 | __out BURN_MSI_PROPERTY* pActionMsiProperty, | ||
1424 | __out INSTALLUILEVEL* pUiLevel, | ||
1425 | __out BOOL* pfDisableExternalUiHandler | ||
1370 | ) | 1426 | ) |
1371 | { | 1427 | { |
1372 | // Assume there will be no internal UI displayed. | 1428 | *pUiLevel = static_cast<INSTALLUILEVEL>(INSTALLUILEVEL_NONE | INSTALLUILEVEL_SOURCERESONLY); |
1373 | INSTALLUILEVEL uiLevel = static_cast<INSTALLUILEVEL>(INSTALLUILEVEL_NONE | INSTALLUILEVEL_SOURCERESONLY); | 1429 | *pfDisableExternalUiHandler = FALSE; |
1374 | 1430 | ||
1375 | // suppress internal UI during uninstall to mimic ARP and "msiexec /x" behavior | 1431 | switch (actionState) |
1376 | if (fDisplayInternalUI && BOOTSTRAPPER_ACTION_STATE_UNINSTALL != actionState && BOOTSTRAPPER_ACTION_STATE_REPAIR != actionState) | ||
1377 | { | 1432 | { |
1378 | switch (display) | 1433 | case BOOTSTRAPPER_ACTION_STATE_UNINSTALL: |
1379 | { | 1434 | *pActionMsiProperty = BURN_MSI_PROPERTY_UNINSTALL; |
1380 | case BOOTSTRAPPER_DISPLAY_FULL: | 1435 | break; |
1381 | uiLevel = INSTALLUILEVEL_FULL; | 1436 | case BOOTSTRAPPER_ACTION_STATE_REPAIR: |
1382 | break; | 1437 | *pActionMsiProperty = BURN_MSI_PROPERTY_REPAIR; |
1383 | 1438 | break; | |
1384 | case BOOTSTRAPPER_DISPLAY_PASSIVE: | 1439 | case BOOTSTRAPPER_ACTION_STATE_MODIFY: |
1385 | uiLevel = INSTALLUILEVEL_REDUCED; | 1440 | *pActionMsiProperty = BURN_MSI_PROPERTY_MODIFY; |
1386 | break; | 1441 | break; |
1387 | } | 1442 | default: |
1443 | *pActionMsiProperty = BURN_MSI_PROPERTY_INSTALL; | ||
1444 | break; | ||
1388 | } | 1445 | } |
1389 | 1446 | ||
1390 | return uiLevel; | 1447 | return UserExperienceOnPlanMsiPackage(pUserExperience, wzPackageId, fExecute, actionState, pActionMsiProperty, pUiLevel, pfDisableExternalUiHandler); |
1391 | } | 1448 | } |
1392 | 1449 | ||
1393 | 1450 | ||
diff --git a/src/engine/msiengine.h b/src/engine/msiengine.h index 2a8ebfd5..cbe80262 100644 --- a/src/engine/msiengine.h +++ b/src/engine/msiengine.h | |||
@@ -32,7 +32,7 @@ HRESULT MsiEnginePlanCalculatePackage( | |||
32 | __out_opt BOOL* pfBARequestedCache | 32 | __out_opt BOOL* pfBARequestedCache |
33 | ); | 33 | ); |
34 | HRESULT MsiEnginePlanAddPackage( | 34 | HRESULT MsiEnginePlanAddPackage( |
35 | __in BOOTSTRAPPER_DISPLAY display, | 35 | __in BURN_USER_EXPERIENCE* pUserExperience, |
36 | __in BURN_PACKAGE* pPackage, | 36 | __in BURN_PACKAGE* pPackage, |
37 | __in BURN_PLAN* pPlan, | 37 | __in BURN_PLAN* pPlan, |
38 | __in BURN_LOGGING* pLog, | 38 | __in BURN_LOGGING* pLog, |
@@ -54,6 +54,10 @@ HRESULT MsiEngineExecutePackage( | |||
54 | __in LPVOID pvContext, | 54 | __in LPVOID pvContext, |
55 | __out BOOTSTRAPPER_APPLY_RESTART* pRestart | 55 | __out BOOTSTRAPPER_APPLY_RESTART* pRestart |
56 | ); | 56 | ); |
57 | HRESULT MsiEngineConcatActionProperty( | ||
58 | __in BURN_MSI_PROPERTY actionMsiProperty, | ||
59 | __deref_out_z LPWSTR* psczProperties | ||
60 | ); | ||
57 | HRESULT MsiEngineConcatProperties( | 61 | HRESULT MsiEngineConcatProperties( |
58 | __in_ecount(cProperties) BURN_MSIPROPERTY* rgProperties, | 62 | __in_ecount(cProperties) BURN_MSIPROPERTY* rgProperties, |
59 | __in DWORD cProperties, | 63 | __in DWORD cProperties, |
@@ -62,10 +66,14 @@ HRESULT MsiEngineConcatProperties( | |||
62 | __deref_out_z LPWSTR* psczProperties, | 66 | __deref_out_z LPWSTR* psczProperties, |
63 | __in BOOL fObfuscateHiddenVariables | 67 | __in BOOL fObfuscateHiddenVariables |
64 | ); | 68 | ); |
65 | INSTALLUILEVEL MsiEngineCalculateInstallUiLevel( | 69 | HRESULT MsiEngineCalculateInstallUiLevel( |
66 | __in BOOL fDisplayInternalUI, | 70 | __in BURN_USER_EXPERIENCE* pUserExperience, |
67 | __in BOOTSTRAPPER_DISPLAY display, | 71 | __in LPCWSTR wzPackageId, |
68 | __in BOOTSTRAPPER_ACTION_STATE actionState | 72 | __in BOOL fExecute, |
73 | __in BOOTSTRAPPER_ACTION_STATE actionState, | ||
74 | __out BURN_MSI_PROPERTY* pActionMsiProperty, | ||
75 | __out INSTALLUILEVEL* pUiLevel, | ||
76 | __out BOOL* pfDisableExternalUiHandler | ||
69 | ); | 77 | ); |
70 | 78 | ||
71 | #if defined(__cplusplus) | 79 | #if defined(__cplusplus) |
diff --git a/src/engine/mspengine.cpp b/src/engine/mspengine.cpp index 463799e6..0dddb366 100644 --- a/src/engine/mspengine.cpp +++ b/src/engine/mspengine.cpp | |||
@@ -44,7 +44,7 @@ static void DeterminePatchChainedTarget( | |||
44 | __out BOOL* pfSlipstreamed | 44 | __out BOOL* pfSlipstreamed |
45 | ); | 45 | ); |
46 | static HRESULT PlanTargetProduct( | 46 | static HRESULT PlanTargetProduct( |
47 | __in BOOTSTRAPPER_DISPLAY display, | 47 | __in BURN_USER_EXPERIENCE* pUserExperience, |
48 | __in BOOL fRollback, | 48 | __in BOOL fRollback, |
49 | __in BURN_PLAN* pPlan, | 49 | __in BURN_PLAN* pPlan, |
50 | __in BURN_LOGGING* pLog, | 50 | __in BURN_LOGGING* pLog, |
@@ -73,10 +73,6 @@ extern "C" HRESULT MspEngineParsePackageFromXml( | |||
73 | hr = XmlGetAttributeEx(pixnMspPackage, L"PatchXml", &pPackage->Msp.sczApplicabilityXml); | 73 | hr = XmlGetAttributeEx(pixnMspPackage, L"PatchXml", &pPackage->Msp.sczApplicabilityXml); |
74 | ExitOnFailure(hr, "Failed to get @PatchXml."); | 74 | ExitOnFailure(hr, "Failed to get @PatchXml."); |
75 | 75 | ||
76 | // @DisplayInternalUI | ||
77 | hr = XmlGetYesNoAttribute(pixnMspPackage, L"DisplayInternalUI", &pPackage->Msp.fDisplayInternalUI); | ||
78 | ExitOnFailure(hr, "Failed to get @DisplayInternalUI."); | ||
79 | |||
80 | // Read properties. | 76 | // Read properties. |
81 | hr = MsiEngineParsePropertiesFromXml(pixnMspPackage, &pPackage->Msp.rgProperties, &pPackage->Msp.cProperties); | 77 | hr = MsiEngineParsePropertiesFromXml(pixnMspPackage, &pPackage->Msp.rgProperties, &pPackage->Msp.cProperties); |
82 | ExitOnFailure(hr, "Failed to parse properties from XML."); | 78 | ExitOnFailure(hr, "Failed to parse properties from XML."); |
@@ -400,7 +396,7 @@ LExit: | |||
400 | // PlanAdd - adds the calculated execute and rollback actions for the package. | 396 | // PlanAdd - adds the calculated execute and rollback actions for the package. |
401 | // | 397 | // |
402 | extern "C" HRESULT MspEnginePlanAddPackage( | 398 | extern "C" HRESULT MspEnginePlanAddPackage( |
403 | __in BOOTSTRAPPER_DISPLAY display, | 399 | __in BURN_USER_EXPERIENCE* pUserExperience, |
404 | __in BURN_PACKAGE* pPackage, | 400 | __in BURN_PACKAGE* pPackage, |
405 | __in BURN_PLAN* pPlan, | 401 | __in BURN_PLAN* pPlan, |
406 | __in BURN_LOGGING* pLog, | 402 | __in BURN_LOGGING* pLog, |
@@ -437,13 +433,13 @@ extern "C" HRESULT MspEnginePlanAddPackage( | |||
437 | 433 | ||
438 | if (BOOTSTRAPPER_ACTION_STATE_NONE != pTargetProduct->execute) | 434 | if (BOOTSTRAPPER_ACTION_STATE_NONE != pTargetProduct->execute) |
439 | { | 435 | { |
440 | hr = PlanTargetProduct(display, FALSE, pPlan, pLog, pVariables, pTargetProduct->execute, pPackage, pTargetProduct, hCacheEvent); | 436 | hr = PlanTargetProduct(pUserExperience, FALSE, pPlan, pLog, pVariables, pTargetProduct->execute, pPackage, pTargetProduct, hCacheEvent); |
441 | ExitOnFailure(hr, "Failed to plan target product."); | 437 | ExitOnFailure(hr, "Failed to plan target product."); |
442 | } | 438 | } |
443 | 439 | ||
444 | if (BOOTSTRAPPER_ACTION_STATE_NONE != pTargetProduct->rollback) | 440 | if (BOOTSTRAPPER_ACTION_STATE_NONE != pTargetProduct->rollback) |
445 | { | 441 | { |
446 | hr = PlanTargetProduct(display, TRUE, pPlan, pLog, pVariables, pTargetProduct->rollback, pPackage, pTargetProduct, hCacheEvent); | 442 | hr = PlanTargetProduct(pUserExperience, TRUE, pPlan, pLog, pVariables, pTargetProduct->rollback, pPackage, pTargetProduct, hCacheEvent); |
447 | ExitOnFailure(hr, "Failed to plan rollack target product."); | 443 | ExitOnFailure(hr, "Failed to plan rollack target product."); |
448 | } | 444 | } |
449 | } | 445 | } |
@@ -464,7 +460,6 @@ extern "C" HRESULT MspEngineExecutePackage( | |||
464 | ) | 460 | ) |
465 | { | 461 | { |
466 | HRESULT hr = S_OK; | 462 | HRESULT hr = S_OK; |
467 | INSTALLUILEVEL uiLevel = pExecuteAction->mspTarget.pPackage->Msp.fDisplayInternalUI ? INSTALLUILEVEL_DEFAULT : static_cast<INSTALLUILEVEL>(INSTALLUILEVEL_NONE | INSTALLUILEVEL_SOURCERESONLY); | ||
468 | WIU_MSI_EXECUTE_CONTEXT context = { }; | 463 | WIU_MSI_EXECUTE_CONTEXT context = { }; |
469 | WIU_RESTART restart = WIU_RESTART_NONE; | 464 | WIU_RESTART restart = WIU_RESTART_NONE; |
470 | 465 | ||
@@ -517,8 +512,16 @@ extern "C" HRESULT MspEngineExecutePackage( | |||
517 | VariableSetNumeric(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_ACTION, pExecuteAction->mspTarget.action, TRUE); | 512 | VariableSetNumeric(pVariables, BURN_BUNDLE_EXECUTE_PACKAGE_ACTION, pExecuteAction->mspTarget.action, TRUE); |
518 | 513 | ||
519 | // Wire up the external UI handler and logging. | 514 | // Wire up the external UI handler and logging. |
520 | hr = WiuInitializeExternalUI(pfnMessageHandler, uiLevel, hwndParent, pvContext, fRollback, &context); | 515 | if (pExecuteAction->mspTarget.fDisableExternalUiHandler) |
521 | ExitOnFailure(hr, "Failed to initialize external UI handler."); | 516 | { |
517 | hr = WiuInitializeInternalUI(pExecuteAction->mspTarget.uiLevel, hwndParent, &context); | ||
518 | ExitOnFailure(hr, "Failed to initialize internal UI for MSP package."); | ||
519 | } | ||
520 | else | ||
521 | { | ||
522 | hr = WiuInitializeExternalUI(pfnMessageHandler, pExecuteAction->mspTarget.uiLevel, hwndParent, pvContext, fRollback, &context); | ||
523 | ExitOnFailure(hr, "Failed to initialize external UI handler."); | ||
524 | } | ||
522 | 525 | ||
523 | //if (BURN_LOGGING_LEVEL_DEBUG == logLevel) | 526 | //if (BURN_LOGGING_LEVEL_DEBUG == logLevel) |
524 | //{ | 527 | //{ |
@@ -538,6 +541,12 @@ extern "C" HRESULT MspEngineExecutePackage( | |||
538 | hr = MsiEngineConcatProperties(pExecuteAction->mspTarget.pPackage->Msp.rgProperties, pExecuteAction->mspTarget.pPackage->Msp.cProperties, pVariables, fRollback, &sczObfuscatedProperties, TRUE); | 541 | hr = MsiEngineConcatProperties(pExecuteAction->mspTarget.pPackage->Msp.rgProperties, pExecuteAction->mspTarget.pPackage->Msp.cProperties, pVariables, fRollback, &sczObfuscatedProperties, TRUE); |
539 | ExitOnFailure(hr, "Failed to add properties to obfuscated argument string."); | 542 | ExitOnFailure(hr, "Failed to add properties to obfuscated argument string."); |
540 | 543 | ||
544 | hr = MsiEngineConcatActionProperty(pExecuteAction->mspTarget.actionMsiProperty, &sczProperties); | ||
545 | ExitOnFailure(hr, "Failed to add action property to argument string."); | ||
546 | |||
547 | hr = MsiEngineConcatActionProperty(pExecuteAction->mspTarget.actionMsiProperty, &sczObfuscatedProperties); | ||
548 | ExitOnFailure(hr, "Failed to add action property to obfuscated argument string."); | ||
549 | |||
541 | LogId(REPORT_STANDARD, MSG_APPLYING_PATCH_PACKAGE, pExecuteAction->mspTarget.pPackage->sczId, LoggingActionStateToString(pExecuteAction->mspTarget.action), sczPatches, sczObfuscatedProperties, pExecuteAction->mspTarget.sczTargetProductCode); | 550 | LogId(REPORT_STANDARD, MSG_APPLYING_PATCH_PACKAGE, pExecuteAction->mspTarget.pPackage->sczId, LoggingActionStateToString(pExecuteAction->mspTarget.action), sczPatches, sczObfuscatedProperties, pExecuteAction->mspTarget.sczTargetProductCode); |
542 | 551 | ||
543 | // | 552 | // |
@@ -868,7 +877,7 @@ static void DeterminePatchChainedTarget( | |||
868 | } | 877 | } |
869 | 878 | ||
870 | static HRESULT PlanTargetProduct( | 879 | static HRESULT PlanTargetProduct( |
871 | __in BOOTSTRAPPER_DISPLAY display, | 880 | __in BURN_USER_EXPERIENCE* pUserExperience, |
872 | __in BOOL fRollback, | 881 | __in BOOL fRollback, |
873 | __in BURN_PLAN* pPlan, | 882 | __in BURN_PLAN* pPlan, |
874 | __in BURN_LOGGING* pLog, | 883 | __in BURN_LOGGING* pLog, |
@@ -920,12 +929,15 @@ static HRESULT PlanTargetProduct( | |||
920 | pAction->mspTarget.action = actionState; | 929 | pAction->mspTarget.action = actionState; |
921 | pAction->mspTarget.pPackage = pPackage; | 930 | pAction->mspTarget.pPackage = pPackage; |
922 | pAction->mspTarget.fPerMachineTarget = (MSIINSTALLCONTEXT_MACHINE == pTargetProduct->context); | 931 | pAction->mspTarget.fPerMachineTarget = (MSIINSTALLCONTEXT_MACHINE == pTargetProduct->context); |
923 | pAction->mspTarget.uiLevel = MsiEngineCalculateInstallUiLevel(pPackage->Msp.fDisplayInternalUI, display, pAction->mspTarget.action); | ||
924 | pAction->mspTarget.pChainedTargetPackage = pTargetProduct->pChainedTargetPackage; | 932 | pAction->mspTarget.pChainedTargetPackage = pTargetProduct->pChainedTargetPackage; |
925 | pAction->mspTarget.fSlipstream = pTargetProduct->fSlipstream; | 933 | pAction->mspTarget.fSlipstream = pTargetProduct->fSlipstream; |
926 | hr = StrAllocString(&pAction->mspTarget.sczTargetProductCode, pTargetProduct->wzTargetProductCode, 0); | 934 | hr = StrAllocString(&pAction->mspTarget.sczTargetProductCode, pTargetProduct->wzTargetProductCode, 0); |
927 | ExitOnFailure(hr, "Failed to copy target product code."); | 935 | ExitOnFailure(hr, "Failed to copy target product code."); |
928 | 936 | ||
937 | hr = MsiEngineCalculateInstallUiLevel(pUserExperience, pPackage->sczId, !fRollback, pAction->mspTarget.action, | ||
938 | &pAction->mspTarget.actionMsiProperty, &pAction->mspTarget.uiLevel, &pAction->mspTarget.fDisableExternalUiHandler); | ||
939 | ExitOnFailure(hr, "Failed to get msp ui options."); | ||
940 | |||
929 | // If this is a per-machine target product, then the plan needs to be per-machine as well. | 941 | // If this is a per-machine target product, then the plan needs to be per-machine as well. |
930 | if (pAction->mspTarget.fPerMachineTarget) | 942 | if (pAction->mspTarget.fPerMachineTarget) |
931 | { | 943 | { |
diff --git a/src/engine/mspengine.h b/src/engine/mspengine.h index 9f585720..0f323e57 100644 --- a/src/engine/mspengine.h +++ b/src/engine/mspengine.h | |||
@@ -38,7 +38,7 @@ HRESULT MspEnginePlanCalculatePackage( | |||
38 | __out_opt BOOL* pfBARequestedCache | 38 | __out_opt BOOL* pfBARequestedCache |
39 | ); | 39 | ); |
40 | HRESULT MspEnginePlanAddPackage( | 40 | HRESULT MspEnginePlanAddPackage( |
41 | __in BOOTSTRAPPER_DISPLAY display, | 41 | __in BURN_USER_EXPERIENCE* pUserExperience, |
42 | __in BURN_PACKAGE* pPackage, | 42 | __in BURN_PACKAGE* pPackage, |
43 | __in BURN_PLAN* pPlan, | 43 | __in BURN_PLAN* pPlan, |
44 | __in BURN_LOGGING* pLog, | 44 | __in BURN_LOGGING* pLog, |
diff --git a/src/engine/package.h b/src/engine/package.h index c295378e..05965a16 100644 --- a/src/engine/package.h +++ b/src/engine/package.h | |||
@@ -239,7 +239,6 @@ typedef struct _BURN_PACKAGE | |||
239 | DWORD64 qwVersion; | 239 | DWORD64 qwVersion; |
240 | LPWSTR sczInstalledProductCode; | 240 | LPWSTR sczInstalledProductCode; |
241 | DWORD64 qwInstalledVersion; | 241 | DWORD64 qwInstalledVersion; |
242 | BOOL fDisplayInternalUI; | ||
243 | LPWSTR sczUpgradeCode; | 242 | LPWSTR sczUpgradeCode; |
244 | 243 | ||
245 | BURN_MSIPROPERTY* rgProperties; | 244 | BURN_MSIPROPERTY* rgProperties; |
@@ -261,7 +260,6 @@ typedef struct _BURN_PACKAGE | |||
261 | { | 260 | { |
262 | LPWSTR sczPatchCode; | 261 | LPWSTR sczPatchCode; |
263 | LPWSTR sczApplicabilityXml; | 262 | LPWSTR sczApplicabilityXml; |
264 | BOOL fDisplayInternalUI; | ||
265 | 263 | ||
266 | BURN_MSIPROPERTY* rgProperties; | 264 | BURN_MSIPROPERTY* rgProperties; |
267 | DWORD cProperties; | 265 | DWORD cProperties; |
diff --git a/src/engine/packages.config b/src/engine/packages.config index e9b2d190..251df9d0 100644 --- a/src/engine/packages.config +++ b/src/engine/packages.config | |||
@@ -1,6 +1,6 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <packages> | 2 | <packages> |
3 | <package id="Nerdbank.GitVersioning" version="2.1.65" targetFramework="native" developmentDependency="true" /> | 3 | <package id="Nerdbank.GitVersioning" version="2.1.65" targetFramework="native" developmentDependency="true" /> |
4 | <package id="WixToolset.BootstrapperCore.Native" version="4.0.15" targetFramework="native" /> | 4 | <package id="WixToolset.BootstrapperCore.Native" version="4.0.16" targetFramework="native" /> |
5 | <package id="WixToolset.DUtil" version="4.0.18" targetFramework="native" /> | 5 | <package id="WixToolset.DUtil" version="4.0.23" targetFramework="native" /> |
6 | </packages> \ No newline at end of file | 6 | </packages> \ No newline at end of file |
diff --git a/src/engine/plan.cpp b/src/engine/plan.cpp index 01c7a31d..02f5be23 100644 --- a/src/engine/plan.cpp +++ b/src/engine/plan.cpp | |||
@@ -31,7 +31,6 @@ static HRESULT ProcessPackage( | |||
31 | __in BURN_PACKAGE* pPackage, | 31 | __in BURN_PACKAGE* pPackage, |
32 | __in BURN_LOGGING* pLog, | 32 | __in BURN_LOGGING* pLog, |
33 | __in BURN_VARIABLES* pVariables, | 33 | __in BURN_VARIABLES* pVariables, |
34 | __in BOOTSTRAPPER_DISPLAY display, | ||
35 | __in BOOTSTRAPPER_RELATION_TYPE relationType, | 34 | __in BOOTSTRAPPER_RELATION_TYPE relationType, |
36 | __in_z_opt LPCWSTR wzLayoutDirectory, | 35 | __in_z_opt LPCWSTR wzLayoutDirectory, |
37 | __inout HANDLE* phSyncpointEvent, | 36 | __inout HANDLE* phSyncpointEvent, |
@@ -473,7 +472,6 @@ extern "C" HRESULT PlanPackages( | |||
473 | __in BURN_LOGGING* pLog, | 472 | __in BURN_LOGGING* pLog, |
474 | __in BURN_VARIABLES* pVariables, | 473 | __in BURN_VARIABLES* pVariables, |
475 | __in BOOL fBundleInstalled, | 474 | __in BOOL fBundleInstalled, |
476 | __in BOOTSTRAPPER_DISPLAY display, | ||
477 | __in BOOTSTRAPPER_RELATION_TYPE relationType, | 475 | __in BOOTSTRAPPER_RELATION_TYPE relationType, |
478 | __in_z_opt LPCWSTR wzLayoutDirectory, | 476 | __in_z_opt LPCWSTR wzLayoutDirectory, |
479 | __inout HANDLE* phSyncpointEvent | 477 | __inout HANDLE* phSyncpointEvent |
@@ -511,7 +509,7 @@ extern "C" HRESULT PlanPackages( | |||
511 | } | 509 | } |
512 | } | 510 | } |
513 | 511 | ||
514 | hr = ProcessPackage(fBundlePerMachine, NULL, pUX, pPlan, pPackage, pLog, pVariables, display, relationType, wzLayoutDirectory, phSyncpointEvent, &pRollbackBoundary, &nonpermanentPackageIndices); | 512 | hr = ProcessPackage(fBundlePerMachine, NULL, pUX, pPlan, pPackage, pLog, pVariables, relationType, wzLayoutDirectory, phSyncpointEvent, &pRollbackBoundary, &nonpermanentPackageIndices); |
515 | ExitOnFailure(hr, "Failed to process package."); | 513 | ExitOnFailure(hr, "Failed to process package."); |
516 | 514 | ||
517 | // Attempt to remove orphaned packages during uninstall. Currently only MSI packages are supported and should not require source. | 515 | // Attempt to remove orphaned packages during uninstall. Currently only MSI packages are supported and should not require source. |
@@ -536,7 +534,7 @@ extern "C" HRESULT PlanPackages( | |||
536 | ExitOnFailure(hr, "Failed to copy installed ProductCode"); | 534 | ExitOnFailure(hr, "Failed to copy installed ProductCode"); |
537 | 535 | ||
538 | // Process the compatible MSI package like any other. | 536 | // Process the compatible MSI package like any other. |
539 | hr = ProcessPackage(fBundlePerMachine, pPackage, pUX, pPlan, pCompatiblePackage, pLog, pVariables, display, relationType, wzLayoutDirectory, phSyncpointEvent, &pRollbackBoundary, &nonpermanentPackageIndices); | 537 | hr = ProcessPackage(fBundlePerMachine, pPackage, pUX, pPlan, pCompatiblePackage, pLog, pVariables, relationType, wzLayoutDirectory, phSyncpointEvent, &pRollbackBoundary, &nonpermanentPackageIndices); |
540 | ExitOnFailure(hr, "Failed to process compatible package."); | 538 | ExitOnFailure(hr, "Failed to process compatible package."); |
541 | 539 | ||
542 | if (BOOTSTRAPPER_ACTION_STATE_UNINSTALL == pCompatiblePackage->execute) | 540 | if (BOOTSTRAPPER_ACTION_STATE_UNINSTALL == pCompatiblePackage->execute) |
@@ -787,7 +785,6 @@ extern "C" HRESULT PlanPassThroughBundle( | |||
787 | __in BURN_PLAN* pPlan, | 785 | __in BURN_PLAN* pPlan, |
788 | __in BURN_LOGGING* pLog, | 786 | __in BURN_LOGGING* pLog, |
789 | __in BURN_VARIABLES* pVariables, | 787 | __in BURN_VARIABLES* pVariables, |
790 | __in BOOTSTRAPPER_DISPLAY display, | ||
791 | __in BOOTSTRAPPER_RELATION_TYPE relationType, | 788 | __in BOOTSTRAPPER_RELATION_TYPE relationType, |
792 | __inout HANDLE* phSyncpointEvent | 789 | __inout HANDLE* phSyncpointEvent |
793 | ) | 790 | ) |
@@ -797,7 +794,7 @@ extern "C" HRESULT PlanPassThroughBundle( | |||
797 | BURN_ROLLBACK_BOUNDARY* pRollbackBoundary = NULL; | 794 | BURN_ROLLBACK_BOUNDARY* pRollbackBoundary = NULL; |
798 | 795 | ||
799 | // Plan passthrough package. | 796 | // Plan passthrough package. |
800 | hr = ProcessPackage(fBundlePerMachine, NULL, pUX, pPlan, pPackage, pLog, pVariables, display, relationType, NULL, phSyncpointEvent, &pRollbackBoundary, NULL); | 797 | hr = ProcessPackage(fBundlePerMachine, NULL, pUX, pPlan, pPackage, pLog, pVariables, relationType, NULL, phSyncpointEvent, &pRollbackBoundary, NULL); |
801 | ExitOnFailure(hr, "Failed to process passthrough package."); | 798 | ExitOnFailure(hr, "Failed to process passthrough package."); |
802 | 799 | ||
803 | // If we still have an open rollback boundary, complete it. | 800 | // If we still have an open rollback boundary, complete it. |
@@ -821,7 +818,6 @@ extern "C" HRESULT PlanUpdateBundle( | |||
821 | __in BURN_PLAN* pPlan, | 818 | __in BURN_PLAN* pPlan, |
822 | __in BURN_LOGGING* pLog, | 819 | __in BURN_LOGGING* pLog, |
823 | __in BURN_VARIABLES* pVariables, | 820 | __in BURN_VARIABLES* pVariables, |
824 | __in BOOTSTRAPPER_DISPLAY display, | ||
825 | __in BOOTSTRAPPER_RELATION_TYPE relationType, | 821 | __in BOOTSTRAPPER_RELATION_TYPE relationType, |
826 | __inout HANDLE* phSyncpointEvent | 822 | __inout HANDLE* phSyncpointEvent |
827 | ) | 823 | ) |
@@ -831,7 +827,7 @@ extern "C" HRESULT PlanUpdateBundle( | |||
831 | BURN_ROLLBACK_BOUNDARY* pRollbackBoundary = NULL; | 827 | BURN_ROLLBACK_BOUNDARY* pRollbackBoundary = NULL; |
832 | 828 | ||
833 | // Plan update package. | 829 | // Plan update package. |
834 | hr = ProcessPackage(fBundlePerMachine, NULL, pUX, pPlan, pPackage, pLog, pVariables, display, relationType, NULL, phSyncpointEvent, &pRollbackBoundary, NULL); | 830 | hr = ProcessPackage(fBundlePerMachine, NULL, pUX, pPlan, pPackage, pLog, pVariables, relationType, NULL, phSyncpointEvent, &pRollbackBoundary, NULL); |
835 | ExitOnFailure(hr, "Failed to process update package."); | 831 | ExitOnFailure(hr, "Failed to process update package."); |
836 | 832 | ||
837 | // If we still have an open rollback boundary, complete it. | 833 | // If we still have an open rollback boundary, complete it. |
@@ -857,7 +853,6 @@ static HRESULT ProcessPackage( | |||
857 | __in BURN_PACKAGE* pPackage, | 853 | __in BURN_PACKAGE* pPackage, |
858 | __in BURN_LOGGING* pLog, | 854 | __in BURN_LOGGING* pLog, |
859 | __in BURN_VARIABLES* pVariables, | 855 | __in BURN_VARIABLES* pVariables, |
860 | __in BOOTSTRAPPER_DISPLAY display, | ||
861 | __in BOOTSTRAPPER_RELATION_TYPE relationType, | 856 | __in BOOTSTRAPPER_RELATION_TYPE relationType, |
862 | __in_z_opt LPCWSTR wzLayoutDirectory, | 857 | __in_z_opt LPCWSTR wzLayoutDirectory, |
863 | __inout HANDLE* phSyncpointEvent, | 858 | __inout HANDLE* phSyncpointEvent, |
@@ -911,7 +906,7 @@ static HRESULT ProcessPackage( | |||
911 | } | 906 | } |
912 | } | 907 | } |
913 | 908 | ||
914 | hr = PlanExecutePackage(fBundlePerMachine, display, pUX, pPlan, pPackage, pLog, pVariables, phSyncpointEvent); | 909 | hr = PlanExecutePackage(fBundlePerMachine, pUX, pPlan, pPackage, pLog, pVariables, phSyncpointEvent); |
915 | ExitOnFailure(hr, "Failed to plan execute package."); | 910 | ExitOnFailure(hr, "Failed to plan execute package."); |
916 | 911 | ||
917 | if (pPackage->fUninstallable && pNonpermanentPackageIndices) | 912 | if (pPackage->fUninstallable && pNonpermanentPackageIndices) |
@@ -1091,7 +1086,6 @@ LExit: | |||
1091 | 1086 | ||
1092 | extern "C" HRESULT PlanExecutePackage( | 1087 | extern "C" HRESULT PlanExecutePackage( |
1093 | __in BOOL fPerMachine, | 1088 | __in BOOL fPerMachine, |
1094 | __in BOOTSTRAPPER_DISPLAY display, | ||
1095 | __in BURN_USER_EXPERIENCE* pUserExperience, | 1089 | __in BURN_USER_EXPERIENCE* pUserExperience, |
1096 | __in BURN_PLAN* pPlan, | 1090 | __in BURN_PLAN* pPlan, |
1097 | __in BURN_PACKAGE* pPackage, | 1091 | __in BURN_PACKAGE* pPackage, |
@@ -1156,11 +1150,11 @@ extern "C" HRESULT PlanExecutePackage( | |||
1156 | break; | 1150 | break; |
1157 | 1151 | ||
1158 | case BURN_PACKAGE_TYPE_MSI: | 1152 | case BURN_PACKAGE_TYPE_MSI: |
1159 | hr = MsiEnginePlanAddPackage(display, pPackage, pPlan, pLog, pVariables, *phSyncpointEvent, pPackage->fAcquire); | 1153 | hr = MsiEnginePlanAddPackage(pUserExperience, pPackage, pPlan, pLog, pVariables, *phSyncpointEvent, pPackage->fAcquire); |
1160 | break; | 1154 | break; |
1161 | 1155 | ||
1162 | case BURN_PACKAGE_TYPE_MSP: | 1156 | case BURN_PACKAGE_TYPE_MSP: |
1163 | hr = MspEnginePlanAddPackage(display, pPackage, pPlan, pLog, pVariables, *phSyncpointEvent, pPackage->fAcquire); | 1157 | hr = MspEnginePlanAddPackage(pUserExperience, pPackage, pPlan, pLog, pVariables, *phSyncpointEvent, pPackage->fAcquire); |
1164 | break; | 1158 | break; |
1165 | 1159 | ||
1166 | case BURN_PACKAGE_TYPE_MSU: | 1160 | case BURN_PACKAGE_TYPE_MSU: |
@@ -3074,7 +3068,7 @@ static void ExecuteActionLog( | |||
3074 | break; | 3068 | break; |
3075 | 3069 | ||
3076 | case BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE: | 3070 | case BURN_EXECUTE_ACTION_TYPE_MSI_PACKAGE: |
3077 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: MSI_PACKAGE package id: %ls, action: %hs, ui level: %u, log path: %ls, logging attrib: %u", wzBase, iAction, pAction->msiPackage.pPackage->sczId, LoggingActionStateToString(pAction->msiPackage.action), pAction->msiPackage.uiLevel, pAction->msiPackage.sczLogPath, pAction->msiPackage.dwLoggingAttributes); | 3071 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: MSI_PACKAGE package id: %ls, action: %hs, action msi property: %u, ui level: %u, disable externaluihandler: %ls, log path: %ls, logging attrib: %u", wzBase, iAction, pAction->msiPackage.pPackage->sczId, LoggingActionStateToString(pAction->msiPackage.action), pAction->msiPackage.actionMsiProperty, pAction->msiPackage.uiLevel, pAction->msiPackage.fDisableExternalUiHandler ? L"yes" : L"no", pAction->msiPackage.sczLogPath, pAction->msiPackage.dwLoggingAttributes); |
3078 | for (DWORD j = 0; j < pAction->msiPackage.cPatches; ++j) | 3072 | for (DWORD j = 0; j < pAction->msiPackage.cPatches; ++j) |
3079 | { | 3073 | { |
3080 | LogStringLine(REPORT_STANDARD, " Patch[%u]: order: %u, msp package id: %ls", j, pAction->msiPackage.rgOrderedPatches->dwOrder, pAction->msiPackage.rgOrderedPatches[j].dwOrder, pAction->msiPackage.rgOrderedPatches[j].pPackage->sczId); | 3074 | LogStringLine(REPORT_STANDARD, " Patch[%u]: order: %u, msp package id: %ls", j, pAction->msiPackage.rgOrderedPatches->dwOrder, pAction->msiPackage.rgOrderedPatches[j].dwOrder, pAction->msiPackage.rgOrderedPatches[j].pPackage->sczId); |
@@ -3082,7 +3076,7 @@ static void ExecuteActionLog( | |||
3082 | break; | 3076 | break; |
3083 | 3077 | ||
3084 | case BURN_EXECUTE_ACTION_TYPE_MSP_TARGET: | 3078 | case BURN_EXECUTE_ACTION_TYPE_MSP_TARGET: |
3085 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: MSP_TARGET package id: %ls, action: %hs, target product code: %ls, target per-machine: %ls, ui level: %u, log path: %ls", wzBase, iAction, pAction->mspTarget.pPackage->sczId, LoggingActionStateToString(pAction->mspTarget.action), pAction->mspTarget.sczTargetProductCode, pAction->mspTarget.fPerMachineTarget ? L"yes" : L"no", pAction->mspTarget.uiLevel, pAction->mspTarget.sczLogPath); | 3079 | LogStringLine(REPORT_STANDARD, "%ls action[%u]: MSP_TARGET package id: %ls, action: %hs, target product code: %ls, target per-machine: %ls, action msi property: %u, ui level: %u, disable externaluihandler: %ls, log path: %ls", wzBase, iAction, pAction->mspTarget.pPackage->sczId, LoggingActionStateToString(pAction->mspTarget.action), pAction->mspTarget.sczTargetProductCode, pAction->mspTarget.fPerMachineTarget ? L"yes" : L"no", pAction->mspTarget.actionMsiProperty, pAction->mspTarget.uiLevel, pAction->mspTarget.fDisableExternalUiHandler ? L"yes" : L"no", pAction->mspTarget.sczLogPath); |
3086 | for (DWORD j = 0; j < pAction->mspTarget.cOrderedPatches; ++j) | 3080 | for (DWORD j = 0; j < pAction->mspTarget.cOrderedPatches; ++j) |
3087 | { | 3081 | { |
3088 | LogStringLine(REPORT_STANDARD, " Patch[%u]: order: %u, msp package id: %ls", j, pAction->mspTarget.rgOrderedPatches[j].dwOrder, pAction->mspTarget.rgOrderedPatches[j].pPackage->sczId); | 3082 | LogStringLine(REPORT_STANDARD, " Patch[%u]: order: %u, msp package id: %ls", j, pAction->mspTarget.rgOrderedPatches[j].dwOrder, pAction->mspTarget.rgOrderedPatches[j].pPackage->sczId); |
diff --git a/src/engine/plan.h b/src/engine/plan.h index 54cfe59d..89f4b4bf 100644 --- a/src/engine/plan.h +++ b/src/engine/plan.h | |||
@@ -245,7 +245,9 @@ typedef struct _BURN_EXECUTE_ACTION | |||
245 | BURN_PACKAGE* pPackage; | 245 | BURN_PACKAGE* pPackage; |
246 | LPWSTR sczLogPath; | 246 | LPWSTR sczLogPath; |
247 | DWORD dwLoggingAttributes; | 247 | DWORD dwLoggingAttributes; |
248 | BURN_MSI_PROPERTY actionMsiProperty; | ||
248 | INSTALLUILEVEL uiLevel; | 249 | INSTALLUILEVEL uiLevel; |
250 | BOOL fDisableExternalUiHandler; | ||
249 | BOOTSTRAPPER_ACTION_STATE action; | 251 | BOOTSTRAPPER_ACTION_STATE action; |
250 | 252 | ||
251 | BOOTSTRAPPER_FEATURE_ACTION* rgFeatures; | 253 | BOOTSTRAPPER_FEATURE_ACTION* rgFeatures; |
@@ -262,7 +264,9 @@ typedef struct _BURN_EXECUTE_ACTION | |||
262 | BOOL fSlipstream; | 264 | BOOL fSlipstream; |
263 | BOOL fPerMachineTarget; | 265 | BOOL fPerMachineTarget; |
264 | LPWSTR sczLogPath; | 266 | LPWSTR sczLogPath; |
267 | BURN_MSI_PROPERTY actionMsiProperty; | ||
265 | INSTALLUILEVEL uiLevel; | 268 | INSTALLUILEVEL uiLevel; |
269 | BOOL fDisableExternalUiHandler; | ||
266 | BOOTSTRAPPER_ACTION_STATE action; | 270 | BOOTSTRAPPER_ACTION_STATE action; |
267 | 271 | ||
268 | BURN_ORDERED_PATCHES* rgOrderedPatches; | 272 | BURN_ORDERED_PATCHES* rgOrderedPatches; |
@@ -404,7 +408,6 @@ HRESULT PlanPackages( | |||
404 | __in BURN_LOGGING* pLog, | 408 | __in BURN_LOGGING* pLog, |
405 | __in BURN_VARIABLES* pVariables, | 409 | __in BURN_VARIABLES* pVariables, |
406 | __in BOOL fBundleInstalled, | 410 | __in BOOL fBundleInstalled, |
407 | __in BOOTSTRAPPER_DISPLAY display, | ||
408 | __in BOOTSTRAPPER_RELATION_TYPE relationType, | 411 | __in BOOTSTRAPPER_RELATION_TYPE relationType, |
409 | __in_z_opt LPCWSTR wzLayoutDirectory, | 412 | __in_z_opt LPCWSTR wzLayoutDirectory, |
410 | __inout HANDLE* phSyncpointEvent | 413 | __inout HANDLE* phSyncpointEvent |
@@ -423,7 +426,6 @@ HRESULT PlanPassThroughBundle( | |||
423 | __in BURN_PLAN* pPlan, | 426 | __in BURN_PLAN* pPlan, |
424 | __in BURN_LOGGING* pLog, | 427 | __in BURN_LOGGING* pLog, |
425 | __in BURN_VARIABLES* pVariables, | 428 | __in BURN_VARIABLES* pVariables, |
426 | __in BOOTSTRAPPER_DISPLAY display, | ||
427 | __in BOOTSTRAPPER_RELATION_TYPE relationType, | 429 | __in BOOTSTRAPPER_RELATION_TYPE relationType, |
428 | __inout HANDLE* phSyncpointEvent | 430 | __inout HANDLE* phSyncpointEvent |
429 | ); | 431 | ); |
@@ -433,7 +435,6 @@ HRESULT PlanUpdateBundle( | |||
433 | __in BURN_PLAN* pPlan, | 435 | __in BURN_PLAN* pPlan, |
434 | __in BURN_LOGGING* pLog, | 436 | __in BURN_LOGGING* pLog, |
435 | __in BURN_VARIABLES* pVariables, | 437 | __in BURN_VARIABLES* pVariables, |
436 | __in BOOTSTRAPPER_DISPLAY display, | ||
437 | __in BOOTSTRAPPER_RELATION_TYPE relationType, | 438 | __in BOOTSTRAPPER_RELATION_TYPE relationType, |
438 | __inout HANDLE* phSyncpointEvent | 439 | __inout HANDLE* phSyncpointEvent |
439 | ); | 440 | ); |
@@ -452,7 +453,6 @@ HRESULT PlanCachePackage( | |||
452 | ); | 453 | ); |
453 | HRESULT PlanExecutePackage( | 454 | HRESULT PlanExecutePackage( |
454 | __in BOOL fPerMachine, | 455 | __in BOOL fPerMachine, |
455 | __in BOOTSTRAPPER_DISPLAY display, | ||
456 | __in BURN_USER_EXPERIENCE* pUserExperience, | 456 | __in BURN_USER_EXPERIENCE* pUserExperience, |
457 | __in BURN_PLAN* pPlan, | 457 | __in BURN_PLAN* pPlan, |
458 | __in BURN_PACKAGE* pPackage, | 458 | __in BURN_PACKAGE* pPackage, |
diff --git a/src/engine/userexperience.cpp b/src/engine/userexperience.cpp index 24fc1ec7..dd59a431 100644 --- a/src/engine/userexperience.cpp +++ b/src/engine/userexperience.cpp | |||
@@ -97,7 +97,7 @@ extern "C" HRESULT UserExperienceLoad( | |||
97 | args.pCommand = pCommand; | 97 | args.pCommand = pCommand; |
98 | args.pfnBootstrapperEngineProc = EngineForApplicationProc; | 98 | args.pfnBootstrapperEngineProc = EngineForApplicationProc; |
99 | args.pvBootstrapperEngineProcContext = pEngineContext; | 99 | args.pvBootstrapperEngineProcContext = pEngineContext; |
100 | args.qwEngineAPIVersion = MAKEQWORDVERSION(0, 0, 0, 7); // TODO: need to decide whether to keep this, and if so when to update it. | 100 | args.qwEngineAPIVersion = MAKEQWORDVERSION(2020, 5, 14, 0); |
101 | 101 | ||
102 | results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); | 102 | results.cbSize = sizeof(BOOTSTRAPPER_CREATE_RESULTS); |
103 | 103 | ||
@@ -1211,7 +1211,9 @@ EXTERN_C BAAPI UserExperienceOnExecutePackageBegin( | |||
1211 | __in BURN_USER_EXPERIENCE* pUserExperience, | 1211 | __in BURN_USER_EXPERIENCE* pUserExperience, |
1212 | __in_z LPCWSTR wzPackageId, | 1212 | __in_z LPCWSTR wzPackageId, |
1213 | __in BOOL fExecute, | 1213 | __in BOOL fExecute, |
1214 | __in BOOTSTRAPPER_ACTION_STATE action | 1214 | __in BOOTSTRAPPER_ACTION_STATE action, |
1215 | __in INSTALLUILEVEL uiLevel, | ||
1216 | __in BOOL fDisableExternalUiHandler | ||
1215 | ) | 1217 | ) |
1216 | { | 1218 | { |
1217 | HRESULT hr = S_OK; | 1219 | HRESULT hr = S_OK; |
@@ -1222,6 +1224,8 @@ EXTERN_C BAAPI UserExperienceOnExecutePackageBegin( | |||
1222 | args.wzPackageId = wzPackageId; | 1224 | args.wzPackageId = wzPackageId; |
1223 | args.fExecute = fExecute; | 1225 | args.fExecute = fExecute; |
1224 | args.action = action; | 1226 | args.action = action; |
1227 | args.uiLevel = uiLevel; | ||
1228 | args.fDisableExternalUiHandler = fDisableExternalUiHandler; | ||
1225 | 1229 | ||
1226 | results.cbSize = sizeof(results); | 1230 | results.cbSize = sizeof(results); |
1227 | 1231 | ||
@@ -1526,6 +1530,45 @@ LExit: | |||
1526 | return hr; | 1530 | return hr; |
1527 | } | 1531 | } |
1528 | 1532 | ||
1533 | EXTERN_C BAAPI UserExperienceOnPlanMsiPackage( | ||
1534 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
1535 | __in_z LPCWSTR wzPackageId, | ||
1536 | __in BOOL fExecute, | ||
1537 | __in BOOTSTRAPPER_ACTION_STATE action, | ||
1538 | __inout BURN_MSI_PROPERTY* pActionMsiProperty, | ||
1539 | __inout INSTALLUILEVEL* pUiLevel, | ||
1540 | __inout BOOL* pfDisableExternalUiHandler | ||
1541 | ) | ||
1542 | { | ||
1543 | HRESULT hr = S_OK; | ||
1544 | BA_ONPLANMSIPACKAGE_ARGS args = { }; | ||
1545 | BA_ONPLANMSIPACKAGE_RESULTS results = { }; | ||
1546 | |||
1547 | args.cbSize = sizeof(args); | ||
1548 | args.wzPackageId = wzPackageId; | ||
1549 | args.fExecute = fExecute; | ||
1550 | args.action = action; | ||
1551 | |||
1552 | results.cbSize = sizeof(results); | ||
1553 | results.actionMsiProperty = *pActionMsiProperty; | ||
1554 | results.uiLevel = *pUiLevel; | ||
1555 | results.fDisableExternalUiHandler = *pfDisableExternalUiHandler; | ||
1556 | |||
1557 | hr = pUserExperience->pfnBAProc(BOOTSTRAPPER_APPLICATION_MESSAGE_ONPLANMSIPACKAGE, &args, &results, pUserExperience->pvBAProcContext); | ||
1558 | ExitOnFailure(hr, "BA OnPlanMsiPackage failed."); | ||
1559 | |||
1560 | if (results.fCancel) | ||
1561 | { | ||
1562 | hr = HRESULT_FROM_WIN32(ERROR_INSTALL_USEREXIT); | ||
1563 | } | ||
1564 | *pActionMsiProperty = results.actionMsiProperty; | ||
1565 | *pUiLevel = results.uiLevel; | ||
1566 | *pfDisableExternalUiHandler = results.fDisableExternalUiHandler; | ||
1567 | |||
1568 | LExit: | ||
1569 | return hr; | ||
1570 | } | ||
1571 | |||
1529 | EXTERN_C BAAPI UserExperienceOnPlanPackageBegin( | 1572 | EXTERN_C BAAPI UserExperienceOnPlanPackageBegin( |
1530 | __in BURN_USER_EXPERIENCE* pUserExperience, | 1573 | __in BURN_USER_EXPERIENCE* pUserExperience, |
1531 | __in_z LPCWSTR wzPackageId, | 1574 | __in_z LPCWSTR wzPackageId, |
diff --git a/src/engine/userexperience.h b/src/engine/userexperience.h index 7d2b743d..a5a97ffa 100644 --- a/src/engine/userexperience.h +++ b/src/engine/userexperience.h | |||
@@ -294,7 +294,9 @@ BAAPI UserExperienceOnExecutePackageBegin( | |||
294 | __in BURN_USER_EXPERIENCE* pUserExperience, | 294 | __in BURN_USER_EXPERIENCE* pUserExperience, |
295 | __in_z LPCWSTR wzPackageId, | 295 | __in_z LPCWSTR wzPackageId, |
296 | __in BOOL fExecute, | 296 | __in BOOL fExecute, |
297 | __in BOOTSTRAPPER_ACTION_STATE action | 297 | __in BOOTSTRAPPER_ACTION_STATE action, |
298 | __in INSTALLUILEVEL uiLevel, | ||
299 | __in BOOL fDisableExternalUiHandler | ||
298 | ); | 300 | ); |
299 | BAAPI UserExperienceOnExecutePackageComplete( | 301 | BAAPI UserExperienceOnExecutePackageComplete( |
300 | __in BURN_USER_EXPERIENCE* pUserExperience, | 302 | __in BURN_USER_EXPERIENCE* pUserExperience, |
@@ -354,6 +356,15 @@ BAAPI UserExperienceOnPlanMsiFeature( | |||
354 | __in_z LPCWSTR wzFeatureId, | 356 | __in_z LPCWSTR wzFeatureId, |
355 | __inout BOOTSTRAPPER_FEATURE_STATE* pRequestedState | 357 | __inout BOOTSTRAPPER_FEATURE_STATE* pRequestedState |
356 | ); | 358 | ); |
359 | BAAPI UserExperienceOnPlanMsiPackage( | ||
360 | __in BURN_USER_EXPERIENCE* pUserExperience, | ||
361 | __in_z LPCWSTR wzPackageId, | ||
362 | __in BOOL fExecute, | ||
363 | __in BOOTSTRAPPER_ACTION_STATE action, | ||
364 | __inout BURN_MSI_PROPERTY* pActionMsiProperty, | ||
365 | __inout INSTALLUILEVEL* pUiLevel, | ||
366 | __inout BOOL* pfDisableExternalUiHandler | ||
367 | ); | ||
357 | BAAPI UserExperienceOnPlanPackageBegin( | 368 | BAAPI UserExperienceOnPlanPackageBegin( |
358 | __in BURN_USER_EXPERIENCE* pUserExperience, | 369 | __in BURN_USER_EXPERIENCE* pUserExperience, |
359 | __in_z LPCWSTR wzPackageId, | 370 | __in_z LPCWSTR wzPackageId, |
diff --git a/src/stub/packages.config b/src/stub/packages.config index 478af2c6..e8115bfa 100644 --- a/src/stub/packages.config +++ b/src/stub/packages.config | |||
@@ -1,5 +1,5 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <packages> | 2 | <packages> |
3 | <package id="Nerdbank.GitVersioning" version="2.1.65" targetFramework="native" developmentDependency="true" /> | 3 | <package id="Nerdbank.GitVersioning" version="2.1.65" targetFramework="native" developmentDependency="true" /> |
4 | <package id="WixToolset.DUtil" version="4.0.18" targetFramework="native" /> | 4 | <package id="WixToolset.DUtil" version="4.0.23" targetFramework="native" /> |
5 | </packages> \ No newline at end of file | 5 | </packages> \ No newline at end of file |
diff --git a/src/stub/stub.vcxproj b/src/stub/stub.vcxproj index 7af42fa9..ce43e0e6 100644 --- a/src/stub/stub.vcxproj +++ b/src/stub/stub.vcxproj | |||
@@ -2,7 +2,7 @@ | |||
2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | 2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> |
3 | 3 | ||
4 | <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | 4 | <Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
5 | <Import Project="..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props')" /> | 5 | <Import Project="..\..\packages\WixToolset.DUtil.4.0.23\build\WixToolset.DUtil.props" Condition="Exists('..\..\packages\WixToolset.DUtil.4.0.23\build\WixToolset.DUtil.props')" /> |
6 | 6 | ||
7 | <ItemGroup Label="ProjectConfigurations"> | 7 | <ItemGroup Label="ProjectConfigurations"> |
8 | <ProjectConfiguration Include="Debug|Win32"> | 8 | <ProjectConfiguration Include="Debug|Win32"> |
@@ -94,6 +94,6 @@ | |||
94 | <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}.</ErrorText> | 94 | <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105.The missing file is {0}.</ErrorText> |
95 | </PropertyGroup> | 95 | </PropertyGroup> |
96 | <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" /> | 96 | <Error Condition="!Exists('..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Nerdbank.GitVersioning.2.1.65\build\Nerdbank.GitVersioning.targets'))" /> |
97 | <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.18\build\WixToolset.DUtil.props'))" /> | 97 | <Error Condition="!Exists('..\..\packages\WixToolset.DUtil.4.0.23\build\WixToolset.DUtil.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\WixToolset.DUtil.4.0.23\build\WixToolset.DUtil.props'))" /> |
98 | </Target> | 98 | </Target> |
99 | </Project> | 99 | </Project> |