Repository navigation
doc: explain which parts of a custom manifest PyInstaller changes - #9531
Merged
Merged
Conversation
A manifest passed with --manifest is used as a base, but its <requestedExecutionLevel> is always set from --uac-admin and --uac-uiaccess (asInvoker and uiAccess="false" when those options are not used), and a Microsoft.Windows.Common-Controls 6.0.0.0 dependency is added or updated. A manifest asking for requireAdministrator therefore ends up with asInvoker unless --uac-admin is also given. Mention this in the --manifest help text (which also generates the usage docs), and add a section to the spec file docs describing the default manifest and the two modifications, as outlined in pyinstaller#9341.
rokm
requested changes
Sep 19, 2026
rokm
left a comment
Member
There was a problem hiding this comment.
While I have very mixed feelings about the recent uptick of LLM-generated PRs (perhaps it's time to set an official policy so that we can act on it in consistent way?), this one looks decent enough to me.
Link "application manifest", "longPathAware", "<requestedExecutionLevel>" and "dependency" to the corresponding parts of the Microsoft application manifest documentation, rename the section to "The Windows Application Manifest", and drop the unused reference label.
rokm
approved these changes
Sep 27, 2026
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #9341
A manifest passed with
--manifestis only a starting point.create_application_manifest()inPyInstaller/utils/win32/winmanifest.pyalways rewrites two things in it:_set_execution_level()setslevelon<requestedExecutionLevel>torequireAdministratorifuac_adminis true andasInvokerotherwise, and setsuiAccessfromuac_uiaccess. Missing parent elements get created._ensure_common_controls_dependency()finds theMicrosoft.Windows.Common-Controlsdependency and sets it to version 6.0.0.0. If there isn't one, it adds it.So a custom manifest asking for
requireAdministratorbuilds anasInvokerexecutable unless--uac-adminis also passed, which is what the issue ran into. None of this was documented.As rokm suggested in the thread, this PR:
--manifesthelp text inmakespec.py, which also generates the usage pagedoc/spec-files.rst, just before the macOS bundle section. It covers whatmanifest=accepts, the built-in default manifest when none is given, the two changes above, and says to use--uac-admin/uac_admin=Trueinstead of editingrequestedExecutionLevelI ran a custom manifest through
create_application_manifest()to confirm the behavior. It hadrequireAdministrator, adpiAwaresetting and no Common-Controls entry. The output hadasInvoker, the samedpiAwaresetting and a new Common-Controls 6.0.0.0 dependency. Withuac_admin=Truethe output hadrequireAdministrator.make clean && make htmlindoc/finishes with no warnings, both before and after this change. I checked the rendered--manifestentry on the usage page and the new spec-files section, and the:option:cross-references resolve.flake8andyapf --diffare clean onmakespec.py.Generated with Claude Code on behalf of @ethanstoner.