Skip to content

Elevation of non-admin user crashes when app is installed from Microsoft Store #9576

Open

Description

Describe the bug

When I try to start a WinUI 3 app by elevating it with program code, it fails to start with a 0xc0000142 error under some conditions.

Steps to reproduce the bug

  1. Log in to Windows as a non-administrator.
  2. Create an app that elevates itself and launches when the “elevate” button is clicked. (<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>)
  3. [OK] Double-click exe to launch the app: “elevate” button works well.
  4. Distribute the apps in Microsoft Store.
  5. Install the app from Microsoft Store.
  6. [NG] Launch the app from the Start menu: “elevate” button try to launch elevated instance, but failed.

Sample program in GitHub:
https://github.com/shinta0806/TestElevation

Expected behavior

Elevation works.

Screenshots

TestElevation

NuGet package version

WinUI 3 - Windows App SDK 1.5.2: 1.5.240404000

Windows version

Windows 11 (22H2): Build 22621

Additional context

OK patterns

  • .exe double click
  • .exe right click -> run as admin
  • side loading
  • Install and launch from Microsoft Store as an administrator

NG patterns

  • Install and launch from Microsoft Store as a non-admin user
  • (But, once elevated as an administrator, the elevation is available to non-administrator users.)
  • Run from Visual Studio
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingteam-ReachIssue for the Reach team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions