Skip to content

Automatic installer log path limits - #6676

Open
JohnMcPMS wants to merge 8 commits into
microsoft:masterfrom
JohnMcPMS:log-path-limits
Open

JohnMcPMS wants to merge 8 commits into
microsoft:masterfrom
JohnMcPMS:log-path-limits

Conversation

@JohnMcPMS

@JohnMcPMS JohnMcPMS commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

📖 Description

The default/manifest installer log file naming strategy will now progressively fall back to lower detail in the file name in an attempt to keep the path length at or under 150 characters. This is fairly aggressive when running packaged, leaving only 25 characters for the username, package id, and version for the longest file name format.

The formats attempted are:

  1. Package Identifier + "." + Package Version + "-" + Timestamp as YY-MM-DD-hh-mm-ss + ".log"
    a. 25 characters for username, package id, version
  2. Package Identifier + "-" + Timestamp as YYMMDDhhmmss + ".log"
    a. 31 characters for username, package id
  3. Package Identifier substring to fit + "-" + Timestamp as hhmmss + ".log"
    a. 37 characters for username, package id substring
  4. shortGuid strategy

Also uses the shortGuid strategy if the configured strategy would result in a path longer than MAX_PATH supports. And if even that would be too long, removes the log file from the install request.

🔗 References

#2036

🔍 Validation

Added unit tests for file name selection.

Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS
JohnMcPMS requested a review from a team as a code owner November 11, 2026 22:27
@AmelBawa-msft
AmirMS (AmelBawa-msft) requested a balanced review from Copilot November 11, 2026 22:29
@github-actions

This comment has been minimized.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The test assertion causes a warnings-as-errors build failure, and the log-path fallback removes unrelated installer options, potentially making installation interactive or causing it to fail.

2 open issues
What changed in this PR

This PR mitigates installer log path limits reported in #2036 by shortening automatically generated names while leaving room for installer-added suffixes.

Changes:

  • Adds progressive filename shortening and short-GUID fallbacks, omitting logging when no automatic path fits.
  • Introduces explicit manifest version-inclusion strategies and tests path budgets, Unicode boundaries, and bypass behavior.
  • Documents the policy and adds a warning for unavailable log paths.
File Description
src/​AppInstallerCommonCore/​Public/​winget/​Manifest.h Declares version-inclusion strategies for manifest path parts.
src/​AppInstallerCommonCore/​Manifest/​Manifest.cpp Implements version-inclusion selection.
src/​AppInstallerCLITests/​YamlManifest.cpp Tests version strategies and path sanitization.
src/​AppInstallerCLITests/​InstallFlow.cpp Tests shortening, fallbacks, Unicode, and explicit-path bypasses.
src/​AppInstallerCLIPackage/​Shared/​Strings/​en-us/​winget.resw Adds the log-path-unavailable warning.
src/​AppInstallerCLICore/​Workflows/​ShellExecuteInstallerHandler.cpp Implements path budgeting and argument-fragment handling.
src/​AppInstallerCLICore/​Workflows/​DownloadFlow.cpp Adopts the explicit drop-unknown-version strategy.
src/​AppInstallerCLICore/​Resources.h Registers the new warning resource.
doc/​Settings.md Documents automatic log naming and limits.
doc/​release-notes/​1.31/​2036-shorter-installer-log-paths.md Adds a user-facing release note.

Review effort: Balanced

@github-actions

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants