aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-08-03 15:38:46 -0500
committerSean Hall <r.sean.hall@gmail.com>2021-08-04 10:03:57 -0500
commit5815688519a60e63e18c13dfe0908d76757cbc53 (patch)
treef2c6b78263ed996f0b36915f7bb5984e87c2e3e2
parentab47449ca6ccd2ae2b6f0bf477bcea7e49aa8f6b (diff)
downloadwix-5815688519a60e63e18c13dfe0908d76757cbc53.tar.gz
wix-5815688519a60e63e18c13dfe0908d76757cbc53.tar.bz2
wix-5815688519a60e63e18c13dfe0908d76757cbc53.zip
Update Burn ARP command lines to skip clean room.
This also adds an escape hatch to Burn for antivirus interfering with clean room.
-rw-r--r--src/burn/engine/core.cpp27
-rw-r--r--src/burn/engine/engine.cpp3
-rw-r--r--src/burn/engine/registration.cpp6
3 files changed, 20 insertions, 16 deletions
diff --git a/src/burn/engine/core.cpp b/src/burn/engine/core.cpp
index f71103a8..0468d406 100644
--- a/src/burn/engine/core.cpp
+++ b/src/burn/engine/core.cpp
@@ -1375,7 +1375,11 @@ extern "C" HRESULT CoreParseCommandLine(
1375 } 1375 }
1376 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], lstrlenW(BURN_COMMANDLINE_SWITCH_CLEAN_ROOM), BURN_COMMANDLINE_SWITCH_CLEAN_ROOM, lstrlenW(BURN_COMMANDLINE_SWITCH_CLEAN_ROOM))) 1376 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], lstrlenW(BURN_COMMANDLINE_SWITCH_CLEAN_ROOM), BURN_COMMANDLINE_SWITCH_CLEAN_ROOM, lstrlenW(BURN_COMMANDLINE_SWITCH_CLEAN_ROOM)))
1377 { 1377 {
1378 if (BURN_MODE_UNTRUSTED != *pMode) 1378 if (BURN_MODE_UNTRUSTED == *pMode)
1379 {
1380 *pMode = BURN_MODE_NORMAL;
1381 }
1382 else
1379 { 1383 {
1380 fInvalidCommandLine = TRUE; 1384 fInvalidCommandLine = TRUE;
1381 TraceLog(E_INVALIDARG, "Multiple mode command-line switches were provided."); 1385 TraceLog(E_INVALIDARG, "Multiple mode command-line switches were provided.");
@@ -1383,17 +1387,18 @@ extern "C" HRESULT CoreParseCommandLine(
1383 1387
1384 // Get a pointer to the next character after the switch. 1388 // Get a pointer to the next character after the switch.
1385 LPCWSTR wzParam = &argv[i][1 + lstrlenW(BURN_COMMANDLINE_SWITCH_CLEAN_ROOM)]; 1389 LPCWSTR wzParam = &argv[i][1 + lstrlenW(BURN_COMMANDLINE_SWITCH_CLEAN_ROOM)];
1386 if (L'=' != wzParam[0] || L'\0' == wzParam[1]) 1390 if (L'\0' != wzParam[0])
1387 {
1388 fInvalidCommandLine = TRUE;
1389 TraceLog(E_INVALIDARG, "Missing required parameter for switch: %ls", BURN_COMMANDLINE_SWITCH_CLEAN_ROOM);
1390 }
1391 else
1392 { 1391 {
1393 *pMode = BURN_MODE_NORMAL; 1392 if (L'=' != wzParam[0])
1394 1393 {
1395 hr = StrAllocString(psczSourceProcessPath, wzParam + 1, 0); 1394 fInvalidCommandLine = TRUE;
1396 ExitOnFailure(hr, "Failed to copy source process path."); 1395 TraceLog(E_INVALIDARG, "Invalid switch: %ls", argv[i]);
1396 }
1397 else if (L'\0' != wzParam[1])
1398 {
1399 hr = StrAllocString(psczSourceProcessPath, wzParam + 1, 0);
1400 ExitOnFailure(hr, "Failed to copy source process path.");
1401 }
1397 } 1402 }
1398 } 1403 }
1399 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, BURN_COMMANDLINE_SWITCH_EMBEDDED, -1)) 1404 else if (CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, &argv[i][1], -1, BURN_COMMANDLINE_SWITCH_EMBEDDED, -1))
diff --git a/src/burn/engine/engine.cpp b/src/burn/engine/engine.cpp
index 4323b540..e6cb1708 100644
--- a/src/burn/engine/engine.cpp
+++ b/src/burn/engine/engine.cpp
@@ -71,8 +71,7 @@ extern "C" BOOL EngineInCleanRoom(
71 // that should be setting this command line option, that is in our control. 71 // that should be setting this command line option, that is in our control.
72 BOOL fInCleanRoom = (wzCommandLine && 72 BOOL fInCleanRoom = (wzCommandLine &&
73 (wzCommandLine[0] == L'-' || wzCommandLine[0] == L'/') && 73 (wzCommandLine[0] == L'-' || wzCommandLine[0] == L'/') &&
74 CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, wzCommandLine + 1, cchCleanRoomSwitch, BURN_COMMANDLINE_SWITCH_CLEAN_ROOM, cchCleanRoomSwitch) && 74 CSTR_EQUAL == ::CompareStringW(LOCALE_INVARIANT, NORM_IGNORECASE, wzCommandLine + 1, cchCleanRoomSwitch, BURN_COMMANDLINE_SWITCH_CLEAN_ROOM, cchCleanRoomSwitch)
75 wzCommandLine[1 + cchCleanRoomSwitch] == L'='
76 ); 75 );
77 76
78 return fInCleanRoom; 77 return fInCleanRoom;
diff --git a/src/burn/engine/registration.cpp b/src/burn/engine/registration.cpp
index 147865fa..0a8fb602 100644
--- a/src/burn/engine/registration.cpp
+++ b/src/burn/engine/registration.cpp
@@ -773,7 +773,7 @@ extern "C" HRESULT RegistrationSessionBegin(
773 else if (BURN_REGISTRATION_MODIFY_DISABLE_BUTTON != pRegistration->modify) // if support modify (aka: did not disable anything) 773 else if (BURN_REGISTRATION_MODIFY_DISABLE_BUTTON != pRegistration->modify) // if support modify (aka: did not disable anything)
774 { 774 {
775 // ModifyPath: [path to exe] /modify 775 // ModifyPath: [path to exe] /modify
776 hr = RegWriteStringFormatted(hkRegistration, REGISTRY_BUNDLE_MODIFY_PATH, L"\"%ls\" /modify", pRegistration->sczCacheExecutablePath); 776 hr = RegWriteStringFormatted(hkRegistration, REGISTRY_BUNDLE_MODIFY_PATH, L"\"%ls\" /%ls /modify", pRegistration->sczCacheExecutablePath, BURN_COMMANDLINE_SWITCH_CLEAN_ROOM);
777 ExitOnFailure(hr, "Failed to write %ls value.", REGISTRY_BUNDLE_MODIFY_PATH); 777 ExitOnFailure(hr, "Failed to write %ls value.", REGISTRY_BUNDLE_MODIFY_PATH);
778 778
779 // NoElevateOnModify: 1 779 // NoElevateOnModify: 1
@@ -796,14 +796,14 @@ extern "C" HRESULT RegistrationSessionBegin(
796 } 796 }
797 797
798 // QuietUninstallString: [path to exe] /uninstall /quiet 798 // QuietUninstallString: [path to exe] /uninstall /quiet
799 hr = RegWriteStringFormatted(hkRegistration, REGISTRY_BUNDLE_QUIET_UNINSTALL_STRING, L"\"%ls\" /uninstall /quiet", pRegistration->sczCacheExecutablePath); 799 hr = RegWriteStringFormatted(hkRegistration, REGISTRY_BUNDLE_QUIET_UNINSTALL_STRING, L"\"%ls\" /%ls /uninstall /quiet", pRegistration->sczCacheExecutablePath, BURN_COMMANDLINE_SWITCH_CLEAN_ROOM);
800 ExitOnFailure(hr, "Failed to write %ls value.", REGISTRY_BUNDLE_QUIET_UNINSTALL_STRING); 800 ExitOnFailure(hr, "Failed to write %ls value.", REGISTRY_BUNDLE_QUIET_UNINSTALL_STRING);
801 801
802 // UninstallString, [path to exe] 802 // UninstallString, [path to exe]
803 // If the modify button is to be disabled, we'll add "/modify" to the uninstall string because the button is "Uninstall/Change". Otherwise, 803 // If the modify button is to be disabled, we'll add "/modify" to the uninstall string because the button is "Uninstall/Change". Otherwise,
804 // it's just the "Uninstall" button so we add "/uninstall" to make the program just go away. 804 // it's just the "Uninstall" button so we add "/uninstall" to make the program just go away.
805 LPCWSTR wzUninstallParameters = (BURN_REGISTRATION_MODIFY_DISABLE_BUTTON == pRegistration->modify) ? L"/modify" : L" /uninstall"; 805 LPCWSTR wzUninstallParameters = (BURN_REGISTRATION_MODIFY_DISABLE_BUTTON == pRegistration->modify) ? L"/modify" : L" /uninstall";
806 hr = RegWriteStringFormatted(hkRegistration, REGISTRY_BUNDLE_UNINSTALL_STRING, L"\"%ls\" %ls", pRegistration->sczCacheExecutablePath, wzUninstallParameters); 806 hr = RegWriteStringFormatted(hkRegistration, REGISTRY_BUNDLE_UNINSTALL_STRING, L"\"%ls\" /%ls %ls", pRegistration->sczCacheExecutablePath, BURN_COMMANDLINE_SWITCH_CLEAN_ROOM, wzUninstallParameters);
807 ExitOnFailure(hr, "Failed to write %ls value.", REGISTRY_BUNDLE_UNINSTALL_STRING); 807 ExitOnFailure(hr, "Failed to write %ls value.", REGISTRY_BUNDLE_UNINSTALL_STRING);
808 808
809 if (pRegistration->softwareTags.cSoftwareTags) 809 if (pRegistration->softwareTags.cSoftwareTags)