Skip to content

Validation is running manifests with elevationProhibited in an elevated context #72224

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

Closed
jedieaston opened this issue Aug 26, 2022 · 7 comments
Labels
Area-Validation-Pipeline Issues related to the manifest validation pipeline. Issue-Bug It either shouldn't be doing this or needs an investigation.

Comments

@jedieaston
Copy link
Contributor

jedieaston commented Aug 26, 2022

As of winget 1.3, winget now supports a ElevationRequirement key for installers, which can tell the client to error out if a user tries to run an installer that will fail when ran as an administrator (microsoft/winget-cli#2126).

The validation service doesn't seem to respect this, and is running installers in an elevated context that have ElevationRequirement: elevationProhibited set. Here's an example using Spotify (#72166):

InstallationClient log:

Installing winget from 'C:\Winget\Dependencies'
winget-cli Installation complete.
WinGet is installed.
Running winget settings --enable LocalManifestFiles
End winget settings --enable LocalManifestFiles
Enabling installation of local manifests succeeded: True
WinGet is installed.
File Watcher -> Register watching C:\, Filter = 
Scope set to: 
Locale set to: 
System Architecture: X86
Running with Elevation: True <----------------------
Starting FileTracker
File Watcher -> Begin watching C:\, Filter = 
Running winget install --manifest D:\TRANSFER\c79454d6-4925-ed11-951f-000d3a9edf5a\Manifest.yaml --accept-package-agreements
End winget install --manifest D:\TRANSFER\c79454d6-4925-ed11-951f-000d3a9edf5a\Manifest.yaml --accept-package-agreements
Installation failed with exit code -1978335146
Stopping FileTracker
File Watcher -> Stop watching C:\, Filter = 

winget install log:

2022-08-26 07:18:37.895 [CORE] WinGet, version [1.3.2091], activity [{E2DC2FEF-304F-444F-9844-056F3881F26C}]
2022-08-26 07:18:37.896 [CORE] OS: Windows.Desktop v10.0.19044.1889
2022-08-26 07:18:37.896 [CORE] Command line Args: C:\Users\Validator\AppData\Local\Microsoft\WindowsApps\winget.exe install --manifest D:\TRANSFER\c79454d6-4925-ed11-951f-000d3a9edf5a\Manifest.yaml --accept-package-agreements
2022-08-26 07:18:37.896 [CORE] Package: Microsoft.DesktopAppInstaller v1.18.2091.0
2022-08-26 07:18:37.896 [CORE] IsCOMCall:0; Caller: winget-cli
2022-08-26 07:18:37.907 [CLI ] WinGet invoked with arguments: 'install' '--manifest' 'D:\TRANSFER\c79454d6-4925-ed11-951f-000d3a9edf5a\Manifest.yaml' '--accept-package-agreements'
2022-08-26 07:18:37.909 [CLI ] Found subcommand: install
2022-08-26 07:18:37.909 [CLI ] Leaf command to execute: root:install
2022-08-26 07:18:37.928 [CLI ] Executing command: install
2022-08-26 07:18:37.932 [CLI ] Manifest fields: Name [Spotify], Version [1.1.92.647.ga4397eb7]
2022-08-26 07:18:37.956 [CLI ] Starting installer selection.
2022-08-26 07:18:37.956 [CLI ] Completed installer selection.
2022-08-26 07:18:37.989 [CLI ] Terminating context: 0x8a150056 at D:\a\_work\1\s\external\pkg\src\AppInstallerCLICore\Workflows\InstallFlow.cpp:7f

This is currently blocking Spotify from being updated, so if this is going to be a painful fix I can remove the ElevationRequirement key until it's resolved.

@ghost ghost added the Needs-Triage This work item needs to be triaged by a member of the core team. label Aug 26, 2022
@denelon denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Triage This work item needs to be triaged by a member of the core team. labels Aug 26, 2022
@denelon
Copy link
Collaborator

denelon commented Aug 26, 2022

We should fix this bug and leave the key in the manifest so the user experience works correctly. Unless I'm interpreting this incorrectly.

@jedieaston
Copy link
Contributor Author

jedieaston commented Aug 26, 2022

You're understanding correctly (it was kind of hard to explain, sorry). I don't want to remove the key, but if this fix is super complicated I wondered if we should remove it temporarily since Spotify is currently entirely borked.

@Trenly
Copy link
Contributor

Trenly commented Aug 26, 2022

Or perhaps someone can manually validate and merge spotify

@denelon
Copy link
Collaborator

denelon commented Aug 27, 2022

Which PR is spotify?

@Kaligula0
Copy link

I think the error I get is related to this issue: The installer cannot be run from an administrator context..
Log:

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                           
Starting package update operation for package id=Spotify.Spotifywith Manager name=Winget
Given installation options are <InstallationOptions: SkipHashCheck=False;InteractiveInstallation=False;RunAsAdministrator=False;Version=;Architecture=;InstallationScope=;InstallationScope=;CustomParameters=;RemoveDataOnUninstall=False>
Process Executable     : C:\Program Files\WingetUI\PackageEngine\Managers\winget-cli_x64\winget.exe
Process Call Arguments :  update --id Spotify.Spotify --exact --accept-source-agreements --silent --disable-interactivity --accept-package-agreements --force --include-unknown
Working Directory      : C:\Users\Ja
    |    - 
    |   ███▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  1024 KB / 9.78 MB
    |   ██████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  2.00 MB / 9.78 MB
    |   █████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  3.00 MB / 9.78 MB
    |   ████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  4.00 MB / 9.78 MB
    |   ███████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  5.00 MB / 9.78 MB
    |   ██████████████████▒▒▒▒▒▒▒▒▒▒▒▒  6.00 MB / 9.78 MB
    |   █████████████████████▒▒▒▒▒▒▒▒▒  7.00 MB / 9.78 MB
    |   ████████████████████████▒▒▒▒▒▒  8.00 MB / 9.78 MB
    |   ███████████████████████████▒▒▒  9.00 MB / 9.78 MB
    |    - 
    | The installer cannot be run from an administrator context.
Process Exit Code      : -1978335146
Process End Time       : 05.04.2024 16:23:34

(I use WingetUI, which is an UI for winget; never used winget alone; but I don't think that matters).

@Trenly
Copy link
Contributor

Trenly commented Apr 30, 2024

@microsoft-github-policy-service microsoft-github-policy-service bot added the Area-Validation-Pipeline Issues related to the manifest validation pipeline. label Apr 30, 2024
@Trenly
Copy link
Contributor

Trenly commented Jan 7, 2025

Close with reason: Resolved;

Ref: #204908

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Validation-Pipeline Issues related to the manifest validation pipeline. Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

No branches or pull requests

4 participants