diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2021-07-02 10:18:08 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2021-07-02 12:50:09 -0500 |
commit | f43d176f95601ff7524e06247166d4f3b6e61c05 (patch) | |
tree | 2e3580ca60c85e1d07a0ab4a2b1279d25fd41f6c /src/burn | |
parent | 9bdf3730cd43e1af8a4ea9be6cf2fba77fcff2d2 (diff) | |
download | wix-f43d176f95601ff7524e06247166d4f3b6e61c05.tar.gz wix-f43d176f95601ff7524e06247166d4f3b6e61c05.tar.bz2 wix-f43d176f95601ff7524e06247166d4f3b6e61c05.zip |
Make the BA responsible for parsing restart prompt behavior.
Fixes #4975
Diffstat (limited to 'src/burn')
-rw-r--r-- | src/burn/engine/core.cpp | 39 | ||||
-rw-r--r-- | src/burn/engine/core.h | 1 | ||||
-rw-r--r-- | src/burn/engine/externalengine.cpp | 2 | ||||
-rw-r--r-- | src/burn/engine/plan.cpp | 2 | ||||
-rw-r--r-- | src/burn/engine/pseudobundle.cpp | 2 |
5 files changed, 3 insertions, 43 deletions
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( | |||
924 | __deref_inout_z LPWSTR* psczCommandLine, | 924 | __deref_inout_z LPWSTR* psczCommandLine, |
925 | __in BOOTSTRAPPER_ACTION action, | 925 | __in BOOTSTRAPPER_ACTION action, |
926 | __in BOOTSTRAPPER_DISPLAY display, | 926 | __in BOOTSTRAPPER_DISPLAY display, |
927 | __in BOOTSTRAPPER_RESTART restart, | ||
928 | __in BOOTSTRAPPER_RELATION_TYPE relationType, | 927 | __in BOOTSTRAPPER_RELATION_TYPE relationType, |
929 | __in BOOL fPassthrough, | 928 | __in BOOL fPassthrough, |
930 | __in_z_opt LPCWSTR wzActiveParent, | 929 | __in_z_opt LPCWSTR wzActiveParent, |
@@ -965,17 +964,6 @@ extern "C" HRESULT CoreRecreateCommandLine( | |||
965 | } | 964 | } |
966 | ExitOnFailure(hr, "Failed to append action state to command-line"); | 965 | ExitOnFailure(hr, "Failed to append action state to command-line"); |
967 | 966 | ||
968 | switch (restart) | ||
969 | { | ||
970 | case BOOTSTRAPPER_RESTART_ALWAYS: | ||
971 | hr = StrAllocConcat(psczCommandLine, L" /forcerestart", 0); | ||
972 | break; | ||
973 | case BOOTSTRAPPER_RESTART_NEVER: | ||
974 | hr = StrAllocConcat(psczCommandLine, L" /norestart", 0); | ||
975 | break; | ||
976 | } | ||
977 | ExitOnFailure(hr, "Failed to append restart state to command-line"); | ||
978 | |||
979 | if (wzActiveParent) | 967 | if (wzActiveParent) |
980 | { | 968 | { |
981 | if (*wzActiveParent) | 969 | if (*wzActiveParent) |
@@ -1246,32 +1234,10 @@ extern "C" HRESULT CoreParseCommandLine( | |||
1246 | CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"silent", -1)) | 1234 | CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"silent", -1)) |
1247 | { | 1235 | { |
1248 | pCommand->display = BOOTSTRAPPER_DISPLAY_NONE; | 1236 | pCommand->display = BOOTSTRAPPER_DISPLAY_NONE; |
1249 | |||
1250 | if (BOOTSTRAPPER_RESTART_UNKNOWN == pCommand->restart) | ||
1251 | { | ||
1252 | pCommand->restart = BOOTSTRAPPER_RESTART_AUTOMATIC; | ||
1253 | } | ||
1254 | } | 1237 | } |
1255 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"passive", -1)) | 1238 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"passive", -1)) |
1256 | { | 1239 | { |
1257 | pCommand->display = BOOTSTRAPPER_DISPLAY_PASSIVE; | 1240 | pCommand->display = BOOTSTRAPPER_DISPLAY_PASSIVE; |
1258 | |||
1259 | if (BOOTSTRAPPER_RESTART_UNKNOWN == pCommand->restart) | ||
1260 | { | ||
1261 | pCommand->restart = BOOTSTRAPPER_RESTART_AUTOMATIC; | ||
1262 | } | ||
1263 | } | ||
1264 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"norestart", -1)) | ||
1265 | { | ||
1266 | pCommand->restart = BOOTSTRAPPER_RESTART_NEVER; | ||
1267 | } | ||
1268 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"forcerestart", -1)) | ||
1269 | { | ||
1270 | pCommand->restart = BOOTSTRAPPER_RESTART_ALWAYS; | ||
1271 | } | ||
1272 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"promptrestart", -1)) | ||
1273 | { | ||
1274 | pCommand->restart = BOOTSTRAPPER_RESTART_PROMPT; | ||
1275 | } | 1241 | } |
1276 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"layout", -1)) | 1242 | else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, L"layout", -1)) |
1277 | { | 1243 | { |
@@ -1653,11 +1619,6 @@ extern "C" HRESULT CoreParseCommandLine( | |||
1653 | pCommand->display = BOOTSTRAPPER_DISPLAY_FULL; | 1619 | pCommand->display = BOOTSTRAPPER_DISPLAY_FULL; |
1654 | } | 1620 | } |
1655 | 1621 | ||
1656 | if (BOOTSTRAPPER_RESTART_UNKNOWN == pCommand->restart) | ||
1657 | { | ||
1658 | pCommand->restart = BOOTSTRAPPER_RESTART_PROMPT; | ||
1659 | } | ||
1660 | |||
1661 | LExit: | 1622 | LExit: |
1662 | if (fInvalidCommandLine) | 1623 | if (fInvalidCommandLine) |
1663 | { | 1624 | { |
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( | |||
210 | __deref_inout_z LPWSTR* psczCommandLine, | 210 | __deref_inout_z LPWSTR* psczCommandLine, |
211 | __in BOOTSTRAPPER_ACTION action, | 211 | __in BOOTSTRAPPER_ACTION action, |
212 | __in BOOTSTRAPPER_DISPLAY display, | 212 | __in BOOTSTRAPPER_DISPLAY display, |
213 | __in BOOTSTRAPPER_RESTART restart, | ||
214 | __in BOOTSTRAPPER_RELATION_TYPE relationType, | 213 | __in BOOTSTRAPPER_RELATION_TYPE relationType, |
215 | __in BOOL fPassthrough, | 214 | __in BOOL fPassthrough, |
216 | __in_z_opt LPCWSTR wzActiveParent, | 215 | __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( | |||
295 | { | 295 | { |
296 | UpdateUninitialize(&pEngineState->update); | 296 | UpdateUninitialize(&pEngineState->update); |
297 | 297 | ||
298 | 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); | 298 | hr = CoreRecreateCommandLine(&sczCommandline, BOOTSTRAPPER_ACTION_INSTALL, pEngineState->command.display, BOOTSTRAPPER_RELATION_NONE, FALSE, pEngineState->registration.sczActiveParent, pEngineState->registration.sczAncestors, NULL, pEngineState->command.wzCommandLine); |
299 | ExitOnFailure(hr, "Failed to recreate command-line for update bundle."); | 299 | ExitOnFailure(hr, "Failed to recreate command-line for update bundle."); |
300 | 300 | ||
301 | // Bundles would fail to use the downloaded update bundle, as the running bundle would be one of the search paths. | 301 | // 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( | |||
1783 | HRESULT hr = S_OK; | 1783 | HRESULT hr = S_OK; |
1784 | 1784 | ||
1785 | // build the resume command-line. | 1785 | // build the resume command-line. |
1786 | hr = CoreRecreateCommandLine(&pRegistration->sczResumeCommandLine, action, pCommand->display, pCommand->restart, pCommand->relationType, pCommand->fPassthrough, pRegistration->sczActiveParent, pRegistration->sczAncestors, pLog->sczPath, pCommand->wzCommandLine); | 1786 | hr = CoreRecreateCommandLine(&pRegistration->sczResumeCommandLine, action, pCommand->display, pCommand->relationType, pCommand->fPassthrough, pRegistration->sczActiveParent, pRegistration->sczAncestors, pLog->sczPath, pCommand->wzCommandLine); |
1787 | ExitOnFailure(hr, "Failed to recreate resume command-line."); | 1787 | ExitOnFailure(hr, "Failed to recreate resume command-line."); |
1788 | 1788 | ||
1789 | LExit: | 1789 | 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( | |||
205 | 205 | ||
206 | // No matter the operation, we're passing the same command-line. That's what makes | 206 | // No matter the operation, we're passing the same command-line. That's what makes |
207 | // this a passthrough bundle. | 207 | // this a passthrough bundle. |
208 | hr = CoreRecreateCommandLine(&sczArguments, pCommand->action, pCommand->display, pCommand->restart, pCommand->relationType, TRUE, wzActiveParent, wzAncestors, wzAppendLogPath, pCommand->wzCommandLine); | 208 | hr = CoreRecreateCommandLine(&sczArguments, pCommand->action, pCommand->display, pCommand->relationType, TRUE, wzActiveParent, wzAncestors, wzAppendLogPath, pCommand->wzCommandLine); |
209 | ExitOnFailure(hr, "Failed to recreate command-line arguments."); | 209 | ExitOnFailure(hr, "Failed to recreate command-line arguments."); |
210 | 210 | ||
211 | hr = StrAllocString(&pPassthroughPackage->Exe.sczInstallArguments, sczArguments, 0); | 211 | hr = StrAllocString(&pPassthroughPackage->Exe.sczInstallArguments, sczArguments, 0); |