From f43d176f95601ff7524e06247166d4f3b6e61c05 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Fri, 2 Jul 2021 10:18:08 -0500 Subject: Make the BA responsible for parsing restart prompt behavior. Fixes #4975 --- src/burn/engine/core.cpp | 39 -------------------------------------- src/burn/engine/core.h | 1 - src/burn/engine/externalengine.cpp | 2 +- src/burn/engine/plan.cpp | 2 +- src/burn/engine/pseudobundle.cpp | 2 +- 5 files changed, 3 insertions(+), 43 deletions(-) (limited to 'src/burn') diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp index 8b97952c..f71103a8 100644 --- a/src/burn/engine/core.cpp +++ b/src/burn/engine/core.cpp @@ -924,7 +924,6 @@ extern "C" HRESULT CoreRecreateCommandLine( __deref_inout_z LPWSTR* psczCommandLine, __in BOOTSTRAPPER_ACTION action, __in BOOTSTRAPPER_DISPLAY display, - __in BOOTSTRAPPER_RESTART restart, __in BOOTSTRAPPER_RELATION_TYPE relationType, __in BOOL fPassthrough, __in_z_opt LPCWSTR wzActiveParent, @@ -965,17 +964,6 @@ extern "C" HRESULT CoreRecreateCommandLine( } ExitOnFailure(hr, "Failed to append action state to command-line"); - switch (restart) - { - case BOOTSTRAPPER_RESTART_ALWAYS: - hr = StrAllocConcat(psczCommandLine, L" /forcerestart", 0); - break; - case BOOTSTRAPPER_RESTART_NEVER: - hr = StrAllocConcat(psczCommandLine, L" /norestart", 0); - break; - } - ExitOnFailure(hr, "Failed to append restart state to command-line"); - if (wzActiveParent) { if (*wzActiveParent) @@ -1246,32 +1234,10 @@ extern "C" HRESULT CoreParseCommandLine( CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"silent", -1)) { pCommand->display = BOOTSTRAPPER_DISPLAY_NONE; - - if (BOOTSTRAPPER_RESTART_UNKNOWN == pCommand->restart) - { - pCommand->restart = BOOTSTRAPPER_RESTART_AUTOMATIC; - } } else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"passive", -1)) { pCommand->display = BOOTSTRAPPER_DISPLAY_PASSIVE; - - if (BOOTSTRAPPER_RESTART_UNKNOWN == pCommand->restart) - { - pCommand->restart = BOOTSTRAPPER_RESTART_AUTOMATIC; - } - } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"norestart", -1)) - { - pCommand->restart = BOOTSTRAPPER_RESTART_NEVER; - } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"forcerestart", -1)) - { - pCommand->restart = BOOTSTRAPPER_RESTART_ALWAYS; - } - else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"promptrestart", -1)) - { - pCommand->restart = BOOTSTRAPPER_RESTART_PROMPT; } else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"layout", -1)) { @@ -1653,11 +1619,6 @@ extern "C" HRESULT CoreParseCommandLine( pCommand->display = BOOTSTRAPPER_DISPLAY_FULL; } - if (BOOTSTRAPPER_RESTART_UNKNOWN == pCommand->restart) - { - pCommand->restart = BOOTSTRAPPER_RESTART_PROMPT; - } - LExit: if (fInvalidCommandLine) { diff --git a/src/burn/engine/core.h b/src/burn/engine/core.h index 0a92d64f..3fa1f04a 100644 --- a/src/burn/engine/core.h +++ b/src/burn/engine/core.h @@ -210,7 +210,6 @@ HRESULT CoreRecreateCommandLine( __deref_inout_z LPWSTR* psczCommandLine, __in BOOTSTRAPPER_ACTION action, __in BOOTSTRAPPER_DISPLAY display, - __in BOOTSTRAPPER_RESTART restart, __in BOOTSTRAPPER_RELATION_TYPE relationType, __in BOOL fPassthrough, __in_z_opt LPCWSTR wzActiveParent, diff --git a/src/burn/engine/externalengine.cpp b/src/burn/engine/externalengine.cpp index 409353e4..a5f75bd4 100644 --- a/src/burn/engine/externalengine.cpp +++ b/src/burn/engine/externalengine.cpp @@ -295,7 +295,7 @@ HRESULT ExternalEngineSetUpdate( { UpdateUninitialize(&pEngineState->update); - hr = CoreRecreateCommandLine(&sczCommandline, BOOTSTRAPPER_ACTION_INSTALL, pEngineState->command.display, pEngineState->command.restart, BOOTSTRAPPER_RELATION_NONE, FALSE, pEngineState->registration.sczActiveParent, pEngineState->registration.sczAncestors, NULL, pEngineState->command.wzCommandLine); + hr = CoreRecreateCommandLine(&sczCommandline, BOOTSTRAPPER_ACTION_INSTALL, pEngineState->command.display, BOOTSTRAPPER_RELATION_NONE, FALSE, pEngineState->registration.sczActiveParent, pEngineState->registration.sczAncestors, NULL, pEngineState->command.wzCommandLine); ExitOnFailure(hr, "Failed to recreate command-line for update bundle."); // Bundles would fail to use the downloaded update bundle, as the running bundle would be one of the search paths. diff --git a/src/burn/engine/plan.cpp b/src/burn/engine/plan.cpp index d1f07508..3d6fc65f 100644 --- a/src/burn/engine/plan.cpp +++ b/src/burn/engine/plan.cpp @@ -1783,7 +1783,7 @@ extern "C" HRESULT PlanSetResumeCommand( HRESULT hr = S_OK; // build the resume command-line. - hr = CoreRecreateCommandLine(&pRegistration->sczResumeCommandLine, action, pCommand->display, pCommand->restart, pCommand->relationType, pCommand->fPassthrough, pRegistration->sczActiveParent, pRegistration->sczAncestors, pLog->sczPath, pCommand->wzCommandLine); + hr = CoreRecreateCommandLine(&pRegistration->sczResumeCommandLine, action, pCommand->display, pCommand->relationType, pCommand->fPassthrough, pRegistration->sczActiveParent, pRegistration->sczAncestors, pLog->sczPath, pCommand->wzCommandLine); ExitOnFailure(hr, "Failed to recreate resume command-line."); LExit: diff --git a/src/burn/engine/pseudobundle.cpp b/src/burn/engine/pseudobundle.cpp index 1b2eae75..351fe044 100644 --- a/src/burn/engine/pseudobundle.cpp +++ b/src/burn/engine/pseudobundle.cpp @@ -205,7 +205,7 @@ extern "C" HRESULT PseudoBundleInitializePassthrough( // No matter the operation, we're passing the same command-line. That's what makes // this a passthrough bundle. - hr = CoreRecreateCommandLine(&sczArguments, pCommand->action, pCommand->display, pCommand->restart, pCommand->relationType, TRUE, wzActiveParent, wzAncestors, wzAppendLogPath, pCommand->wzCommandLine); + hr = CoreRecreateCommandLine(&sczArguments, pCommand->action, pCommand->display, pCommand->relationType, TRUE, wzActiveParent, wzAncestors, wzAppendLogPath, pCommand->wzCommandLine); ExitOnFailure(hr, "Failed to recreate command-line arguments."); hr = StrAllocString(&pPassthroughPackage->Exe.sczInstallArguments, sczArguments, 0); -- cgit v1.2.3-55-g6feb