From 53d84c9b96b027df505ab99f3db0719a82108b2b Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sat, 9 Nov 2024 23:54:49 -0500 Subject: 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(-) (limited to 'src/burn') diff --git a/src/burn/engine/apply.cpp b/src/burn/engine/apply.cpp index 6908e955..0f65b0ad 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 932b6931..916b6d8b 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 8a1f6510..60c16c01 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 1b4a7b7f..b28a53d4 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 fd8a32a4..e0bc81dd 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) -- cgit v1.2.3-55-g6feb