From 2f9fc08e4c01b6ec04d680aa88ba485db7c3e103 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sat, 9 Nov 2024 23:54:49 -0500 Subject: [PATCH 1/3] Log bundle registration scope. --- src/burn/engine/apply.cpp | 2 +- src/burn/engine/engine.mc | 6 +++--- src/burn/engine/logging.cpp | 7 +++++++ src/burn/engine/logging.h | 4 ++++ src/burn/engine/registration.cpp | 4 ++-- 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/burn/engine/apply.cpp b/src/burn/engine/apply.cpp index 6908e9558..0f65b0ad1 100644 --- a/src/burn/engine/apply.cpp +++ b/src/burn/engine/apply.cpp @@ -536,7 +536,7 @@ extern "C" HRESULT ApplyUnregister( IgnoreRollbackError(hrRegistrationRollback, "Dependent registration actions failed"); } - LogId(REPORT_STANDARD, MSG_SESSION_END, pEngineState->registration.sczRegistrationKey, LoggingResumeModeToString(resumeMode), LoggingRestartToString(restart), LoggingBoolToString(pEngineState->registration.fDisableResume), LoggingRegistrationTypeToString(defaultRegistrationType), LoggingRegistrationTypeToString(registrationType)); + LogId(REPORT_STANDARD, MSG_SESSION_END, pEngineState->registration.sczRegistrationKey, LoggingInstallScopeToString(pEngineState->registration.fPerMachine), LoggingResumeModeToString(resumeMode), LoggingRestartToString(restart), LoggingBoolToString(pEngineState->registration.fDisableResume), LoggingRegistrationTypeToString(defaultRegistrationType), LoggingRegistrationTypeToString(registrationType)); if (BOOTSTRAPPER_ACTION_UNSAFE_UNINSTALL == pEngineState->plan.action) { diff --git a/src/burn/engine/engine.mc b/src/burn/engine/engine.mc index 932b69315..916b6d8b2 100644 --- a/src/burn/engine/engine.mc +++ b/src/burn/engine/engine.mc @@ -1027,21 +1027,21 @@ MessageId=370 Severity=Success SymbolicName=MSG_SESSION_BEGIN Language=English -Session begin, registration key: %1!ls!, options: 0x%2!x!, disable resume: %3!hs! +Session begin, registration key: %1!ls!, scope: %2!hs!, options: 0x%3!x!, disable resume: %4!hs! . MessageId=371 Severity=Success SymbolicName=MSG_SESSION_UPDATE Language=English -Updating session, registration key: %1!ls!, resume: %2!hs!, restart initiated: %3!hs!, disable resume: %4!hs! +Updating session, registration key: %1!ls!, scope: %2!hs!, resume: %3!hs!, restart initiated: %4!hs!, disable resume: %5!hs! . MessageId=372 Severity=Success SymbolicName=MSG_SESSION_END Language=English -Session end, registration key: %1!ls!, resume: %2!hs!, restart: %3!hs!, disable resume: %4!hs!, default registration: %5!hs!, ba requested registration: %6!hs! +Session end, registration key: %1!ls!, scope: %2!hs!, resume: %3!hs!, restart: %4!hs!, disable resume: %5!hs!, default registration: %6!hs!, ba requested registration: %7!hs! . MessageId=373 diff --git a/src/burn/engine/logging.cpp b/src/burn/engine/logging.cpp index 8a1f65107..60c16c015 100644 --- a/src/burn/engine/logging.cpp +++ b/src/burn/engine/logging.cpp @@ -959,6 +959,13 @@ extern "C" LPWSTR LoggingStringOrUnknownIfNull( return wz ? wz : L"Unknown"; } +extern "C" LPCSTR LoggingInstallScopeToString( + __in BOOL fPerMachine + ) +{ + return fPerMachine ? "PerMachine" : "PerUser"; +} + // internal function declarations diff --git a/src/burn/engine/logging.h b/src/burn/engine/logging.h index 1b4a7b7f1..b28a53d44 100644 --- a/src/burn/engine/logging.h +++ b/src/burn/engine/logging.h @@ -198,6 +198,10 @@ LPWSTR LoggingStringOrUnknownIfNull( __in LPCWSTR wz ); +LPCSTR LoggingInstallScopeToString( + __in BOOL fPerMachine + ); + #if defined(__cplusplus) } diff --git a/src/burn/engine/registration.cpp b/src/burn/engine/registration.cpp index fd8a32a48..e0bc81dd1 100644 --- a/src/burn/engine/registration.cpp +++ b/src/burn/engine/registration.cpp @@ -616,7 +616,7 @@ extern "C" HRESULT RegistrationSessionBegin( AssertSz(BOOTSTRAPPER_REGISTRATION_TYPE_NONE != registrationType, "Registration type can't be NONE"); - LogId(REPORT_VERBOSE, MSG_SESSION_BEGIN, pRegistration->sczRegistrationKey, dwRegistrationOptions, LoggingBoolToString(pRegistration->fDisableResume)); + LogId(REPORT_VERBOSE, MSG_SESSION_BEGIN, pRegistration->sczRegistrationKey, LoggingInstallScopeToString(pRegistration->fPerMachine), dwRegistrationOptions, LoggingBoolToString(pRegistration->fDisableResume)); // Cache bundle executable. if (dwRegistrationOptions & BURN_REGISTRATION_ACTION_OPERATIONS_CACHE_BUNDLE) @@ -1259,7 +1259,7 @@ static HRESULT UpdateResumeMode( LPWSTR sczRunOnceCommandLine = NULL; LPCWSTR sczResumeKey = REGISTRY_RUN_ONCE_KEY; - LogId(REPORT_STANDARD, MSG_SESSION_UPDATE, pRegistration->sczRegistrationKey, LoggingResumeModeToString(resumeMode), LoggingBoolToString(fRestartInitiated), LoggingBoolToString(pRegistration->fDisableResume)); + LogId(REPORT_STANDARD, MSG_SESSION_UPDATE, pRegistration->sczRegistrationKey, LoggingInstallScopeToString(pRegistration->fPerMachine), LoggingResumeModeToString(resumeMode), LoggingBoolToString(fRestartInitiated), LoggingBoolToString(pRegistration->fDisableResume)); // write resume information if (hkRegistration) From 46fce3c40fc6ee4af9ba563e5335a65b6f725e6a Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sun, 10 Nov 2024 13:53:02 -0500 Subject: [PATCH 2/3] Update to nonwhingy System.Text.Json. --- src/internal/SetBuildNumber/Directory.Packages.props.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/internal/SetBuildNumber/Directory.Packages.props.pp b/src/internal/SetBuildNumber/Directory.Packages.props.pp index 721771d0c..552aab87f 100644 --- a/src/internal/SetBuildNumber/Directory.Packages.props.pp +++ b/src/internal/SetBuildNumber/Directory.Packages.props.pp @@ -53,7 +53,7 @@ - + From 57b4b7f0086ca527f2c1ec0a3deb5354e4727544 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sun, 10 Nov 2024 14:11:16 -0500 Subject: [PATCH 3/3] Typos are bad; visible typos are an abomination. At least one person makes the same typo almost-but-not-quite everywhere. --- src/api/burn/balutil/balutil.cpp | 2 +- src/api/burn/balutil/inc/balutil.h | 2 +- src/burn/engine/engine.cpp | 2 +- src/burn/engine/engine.mc | 2 +- .../TestData/BAFunctionsTests/BundleAv1/BundleAv1.wixproj | 2 +- .../TestData/BasicFunctionalityTests/BundleB/BundleB.wixproj | 2 +- src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs | 2 +- src/wix/WixToolset.Core.Burn/BurnBackendErrors.cs | 2 +- .../TestData/BadInput/DuplicatePayloadNames.wxs | 2 +- .../TestData/BundleWithPackageGroupRef/Bundle.wxs | 4 ++-- .../TestData/Payload/SharedBAAndPackagePayloadBundle.wxs | 2 +- 11 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/api/burn/balutil/balutil.cpp b/src/api/burn/balutil/balutil.cpp index 5d8bfa9ce..716f82d31 100644 --- a/src/api/burn/balutil/balutil.cpp +++ b/src/api/burn/balutil/balutil.cpp @@ -162,7 +162,7 @@ DAPI_(VOID) BalDebuggerCheck() if (fDebug) { - hr = ::StringCchPrintfW(wzMessage, countof(wzMessage), L"To debug the boostrapper application process %ls\n\nSet breakpoints and attach a debugger to process id: %d (0x%x)", wzModuleFilename, ::GetCurrentProcessId(), ::GetCurrentProcessId()); + hr = ::StringCchPrintfW(wzMessage, countof(wzMessage), L"To debug the bootstrapper application process %ls\n\nSet breakpoints and attach a debugger to process id: %d (0x%x)", wzModuleFilename, ::GetCurrentProcessId(), ::GetCurrentProcessId()); if (SUCCEEDED(hr)) { diff --git a/src/api/burn/balutil/inc/balutil.h b/src/api/burn/balutil/inc/balutil.h index 32190b560..03575883a 100644 --- a/src/api/burn/balutil/inc/balutil.h +++ b/src/api/burn/balutil/inc/balutil.h @@ -44,7 +44,7 @@ static const HRESULT E_PREREQBA_INFINITE_LOOP = MAKE_HRESULT(SEVERITY_ERROR, FAC /******************************************************************* BalDebuggerCheck - allows bootstrapper application to explicitly check - whether a debugger should be attached to the boostrapper application. + whether a debugger should be attached to the bootstrapper application. Note: Automatically called in BootstrapperApplicationRun(). ********************************************************************/ diff --git a/src/burn/engine/engine.cpp b/src/burn/engine/engine.cpp index 619ff0d1f..d7ef40d78 100644 --- a/src/burn/engine/engine.cpp +++ b/src/burn/engine/engine.cpp @@ -782,7 +782,7 @@ static HRESULT RunApplication( { // If the BA requested a reload but we do not have a secondary EXE, // then log a message and do not reload. - LogId(REPORT_STANDARD, MSG_BA_NO_SECONDARY_BOOSTRAPPER_SO_RELOAD_NOT_SUPPORTED); + LogId(REPORT_STANDARD, MSG_BA_NO_SECONDARY_BOOTSTRAPPER_SO_RELOAD_NOT_SUPPORTED); *pfReloadApp = FALSE; } diff --git a/src/burn/engine/engine.mc b/src/burn/engine/engine.mc index 916b6d8b2..c7a073859 100644 --- a/src/burn/engine/engine.mc +++ b/src/burn/engine/engine.mc @@ -255,7 +255,7 @@ Bootstrapper application already requested to quit, ignoring request: '%1!hs!'. MessageId=59 Severity=Warning -SymbolicName=MSG_BA_NO_SECONDARY_BOOSTRAPPER_SO_RELOAD_NOT_SUPPORTED +SymbolicName=MSG_BA_NO_SECONDARY_BOOTSTRAPPER_SO_RELOAD_NOT_SUPPORTED Language=English Bootstrapper application requested reload but there is no secondary bootstrapper application, ignoring the request to reload. . diff --git a/src/test/burn/TestData/BAFunctionsTests/BundleAv1/BundleAv1.wixproj b/src/test/burn/TestData/BAFunctionsTests/BundleAv1/BundleAv1.wixproj index d2688a00b..2d241963b 100644 --- a/src/test/burn/TestData/BAFunctionsTests/BundleAv1/BundleAv1.wixproj +++ b/src/test/burn/TestData/BAFunctionsTests/BundleAv1/BundleAv1.wixproj @@ -5,7 +5,7 @@ - + diff --git a/src/test/burn/TestData/BasicFunctionalityTests/BundleB/BundleB.wixproj b/src/test/burn/TestData/BasicFunctionalityTests/BundleB/BundleB.wixproj index 06b07dcb2..1a8026565 100644 --- a/src/test/burn/TestData/BasicFunctionalityTests/BundleB/BundleB.wixproj +++ b/src/test/burn/TestData/BasicFunctionalityTests/BundleB/BundleB.wixproj @@ -13,7 +13,7 @@ - + diff --git a/src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs b/src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs index 3dbbffa7f..91146a0fc 100644 --- a/src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs +++ b/src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs @@ -108,7 +108,7 @@ public void Execute() command.Execute(); } - // Find the primary boostrapper application and optional secondary. + // Find the primary bootstrapper application and optional secondary. WixBootstrapperApplicationSymbol primaryBootstrapperApplicationSymbol = null; WixBootstrapperApplicationSymbol secondaryBootstrapperApplicationSymbol = null; { diff --git a/src/wix/WixToolset.Core.Burn/BurnBackendErrors.cs b/src/wix/WixToolset.Core.Burn/BurnBackendErrors.cs index c7003a2a4..2daf376f4 100644 --- a/src/wix/WixToolset.Core.Burn/BurnBackendErrors.cs +++ b/src/wix/WixToolset.Core.Burn/BurnBackendErrors.cs @@ -115,7 +115,7 @@ public static Message TooManyBootstrapperApplications(SourceLineNumber sourceLin public static Message BundleMissingBootstrapperApplicationContainer(SourceLineNumber sourceLineNumbers, string path) { - return Message(sourceLineNumbers, Ids.BundleMissingBootstrapperApplicationContainer, "Bundle is invalid. The BoostrapperApplication attached container is missing from the file: {0}", path); + return Message(sourceLineNumbers, Ids.BundleMissingBootstrapperApplicationContainer, "Bundle is invalid. The BootstrapperApplication attached container is missing from the file: {0}", path); } private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BadInput/DuplicatePayloadNames.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BadInput/DuplicatePayloadNames.wxs index eead3c369..e713581a5 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BadInput/DuplicatePayloadNames.wxs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BadInput/DuplicatePayloadNames.wxs @@ -2,7 +2,7 @@ - + diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithPackageGroupRef/Bundle.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithPackageGroupRef/Bundle.wxs index 7d4069908..8ea74fe4f 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithPackageGroupRef/Bundle.wxs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/BundleWithPackageGroupRef/Bundle.wxs @@ -1,7 +1,7 @@ - + @@ -10,6 +10,6 @@ - + diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Payload/SharedBAAndPackagePayloadBundle.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Payload/SharedBAAndPackagePayloadBundle.wxs index d7425318c..57e0030c5 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Payload/SharedBAAndPackagePayloadBundle.wxs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/Payload/SharedBAAndPackagePayloadBundle.wxs @@ -7,7 +7,7 @@ - +