Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log bundle registration scope. #574

Merged
merged 3 commits into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api/burn/balutil/balutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
{
Expand Down
2 changes: 1 addition & 1 deletion src/api/burn/balutil/inc/balutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -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().
********************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion src/burn/engine/apply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 1 addition & 1 deletion src/burn/engine/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
8 changes: 4 additions & 4 deletions src/burn/engine/engine.mc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
.
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions src/burn/engine/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions src/burn/engine/logging.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ LPWSTR LoggingStringOrUnknownIfNull(
__in LPCWSTR wz
);

LPCSTR LoggingInstallScopeToString(
__in BOOL fPerMachine
);


#if defined(__cplusplus)
}
Expand Down
4 changes: 2 additions & 2 deletions src/burn/engine/registration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/internal/SetBuildNumber/Directory.Packages.props.pp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<PackageVersion Include="System.Reflection.Metadata" Version="1.8.1" />
<PackageVersion Include="System.Security.Principal.Windows" Version="4.7.0" />
<PackageVersion Include="System.Text.Encoding.CodePages" Version="4.7.1" />
<PackageVersion Include="System.Text.Json" Version="6.0.9" />
<PackageVersion Include="System.Text.Json" Version="6.0.10" />
barnson marked this conversation as resolved.
Show resolved Hide resolved

<PackageVersion Include="Microsoft.AspNetCore.Owin" Version="3.1.13" />
<PackageVersion Include="Microsoft.VisualStudio.Setup.Configuration.Native" Version="3.10.2154" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ProjectReference Include="..\PackageAv1\PackageAv1.wixproj" />
</ItemGroup>
<ItemGroup>
<!-- For testing purposes: Use old Bal WiX extension instead of new BoostrapperApplications.wixext -->
<!-- For testing purposes: Use old Bal WiX extension instead of new BootstrapperApplications.wixext -->
<PackageReference Include="WixToolset.Bal.wixext" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" />
</ItemGroup>
<ItemGroup>
<!-- For testing purposes: Use old Bal WiX extension instead of new BoostrapperApplications.wixext -->
<!-- For testing purposes: Use old Bal WiX extension instead of new BootstrapperApplications.wixext -->
<PackageReference Include="WixToolset.Bal.wixext" />
<PackageReference Include="WixToolset.NetFx.wixext" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/wix/WixToolset.Core.Burn/Bind/BindBundleCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
{
Expand Down
2 changes: 1 addition & 1 deletion src/wix/WixToolset.Core.Burn/BurnBackendErrors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">

<Fragment>
<PayloadGroup Id="override ExtraBoostrapperApplicationPayloads">
<PayloadGroup Id="override ExtraBootstrapperApplicationPayloads">
<Payload Id="DuplicatePayloadNames.wxs" SourceFile="$(sys.SOURCEFILEPATH)" Name="fakeba.dll" />
<Payload Id="UnscheduledPackage.wxs" SourceFile="$(sys.SOURCEFILEDIR)UnscheduledPackage.wxs" Name="BootstrapperApplicationData.xml" />
<Payload Id="UnscheduledRollbackBoundary.wxs" SourceFile="$(sys.SOURCEFILEDIR)UnscheduledRollbackBoundary.wxs" Name="BootstrapperExtensionData.xml" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Bundle Name="BurnBundle" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="B94478B1-E1F3-4700-9CE8-6AA090854AEC">
<BootstrapperApplication SourceFile="fakeba.dll">
<PayloadGroupRef Id="ExtraBoostrapperApplicationPayloads" />
<PayloadGroupRef Id="ExtraBootstrapperApplicationPayloads" />
</BootstrapperApplication>

<Chain>
Expand All @@ -10,6 +10,6 @@
</Bundle>

<Fragment>
<PayloadGroup Id="virtual ExtraBoostrapperApplicationPayloads" />
<PayloadGroup Id="virtual ExtraBootstrapperApplicationPayloads" />
</Fragment>
</Wix>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</ExePackage>
</PackageGroup>

<PayloadGroup Id="override ExtraBoostrapperApplicationPayloads">
<PayloadGroup Id="override ExtraBootstrapperApplicationPayloads">
<PayloadGroupRef Id="Shared" />
</PayloadGroup>

Expand Down
Loading