From 24bf45a6aec273d1e3a05914bfd3d65f495d9669 Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sat, 9 Nov 2024 23:54:49 -0500 Subject: [PATCH] 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 ++-- src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs | 2 +- 6 files changed, 18 insertions(+), 7 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) 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; {