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
"Open as administrator" launches UWP apps without elevated permissions #605
Comments
Hm, I don't think UWP apps can run elevated in any scenario. It probably makes sense to hide this option for UWP apps. |
(apologies for bumping this dormant issue thread; I've been pretty busy with school.) I've been noticing that Windows Terminal can in fact be run as administrator when launched via the Start Menu, and it behaves pretty much like Command Prompt or PowerShell do when launched in an elevated fashion. (WT is basically just PowerShell with tabs.) the curious thing here is that when using PowerToys Run (acts similar to Spotlight on a Mac), Windows Terminal can be directly executed as an administrator like it can in the Start Menu. the underlying file launched here is the WindowsTerminal.exe binary (see below screenshot), which I can't manually invoke with administrator permissions if I right-click on the file in File Explorer and then just choose "Run as administrator". (that throws an error, and I'm guessing Cairo programmatically is trying and failing to elevate it with that same approach.) I did some digging around in the PowerToys repo to see if I could try to pick apart specific functions that handle the actual elevation request, and all I've found so far are files that check whether programs can be elevated (via I know this likely would involve some amount of work on your end, so no worries if you can't/aren't willing to look into it; I thought I should at least try to point in the right direction for a working example. |
Hm, this is intriguing. The above links show that PowerToys is running the app as admin in the exact same way we run win32 apps as admin. However, we launch UWP apps differently than win32 apps. I've had issues running UWP exe files directly in the past, but this shows it can work, so I'll need to do some testing to see what we can do in this scenario. |
Ah, I've figured it out. Launching directly from shell:appsfolder seems to run as admin for apps that allow it. I'll need to check the app manifest for if the app allows running as admin. |
Refactored AppGrabberService to reduce nesting Saves if app allows run as admin to config file with migration process Fixed admin dialog not saving Fixed quick launch context menu not hiding admin option Fixed quick launch context menu not having run as user option
Describe the bug
when using Cairo to launch a UWP app (such as Windows Terminal or PowerShell Preview) via right-click -> "Open as administrator", no UAC prompt appears and the app is launched without elevated permissions.
Steps to reproduce
Expected behavior
a UAC prompt should appear for the app.
System information:
Additional context
if launched via the dynamic desktop (or when the desktop is enabled in Cairo), the UAC prompt appears correctly when using right-click -> Run as administrator.
non-UWP apps, like DIscord, correctly trigger UAC prompts if launched via "Open as adminstrator".
Screenshots
N/A.
The text was updated successfully, but these errors were encountered: