Skip to content
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

Run as Administrator no longer works #2042

Closed
DJackman123 opened this issue Jul 19, 2019 · 8 comments · Fixed by #2043
Closed

Run as Administrator no longer works #2042

DJackman123 opened this issue Jul 19, 2019 · 8 comments · Fixed by #2043
Labels
Area-Build Issues pertaining to the build system, CI, infrastructure, meta Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. Severity-Crash Crashes are real bad news.

Comments

@DJackman123
Copy link
Contributor

With the latest build I am no longer able to launch Terminal as administrator. This isn't the same as #1872 because I only get the UAC prompt once and I'm not seeing the other message box as is reported there.

I was able to determine that this problem was introduced with commit 8ffff8e (#1948).

Environment

Windows build number: 10.0.18362.10005
Windows Terminal version (if applicable): 0.2.1991.0

Any other software?

Steps to reproduce

Try to launch the app as administrator

Expected behavior

UAC prompt appears then the elevated Terminal runs

Actual behavior

UAC prompt appears and the border of a window is displayed but the process hangs at that point. I have to kill the process with Task Manager.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Jul 19, 2019
@metathinker
Copy link
Contributor

metathinker commented Jul 19, 2019

I've also been able to reproduce this problem on my own build of Terminal master (dca0ffe) and was about to file my own bug!

the border of a window is displayed but the process hangs at that point

I've found that:

  • the application only freezes in the debug build; the release build crashes quickly
  • after some time, the app will unfreeze and you'll get a Microsoft CRT dialog warning you that abort() was called, which you can use to kill the app.

From my debugging, it appears that Terminal crashes when trying to activate the Windows Runtime class TerminalApp.TitlebarControl; RoGetActivationFactory() returns "Class not registered" (HRESULT REGDB_E_CLASSNOTREG == 0x80040154).

This class was introduced yesterday as part of the faulty change 8ffff8e (PR #1948) noted above. I verified that rebuilding Terminal after going back to the immediately previous commit makes the problem disappear.

@metathinker
Copy link
Contributor

I can reproduce the problem reliably when I run my own build of Terminal master after deploying the loose-file app package folder with PowerShell.

As a (possibly misleading!) point of interest, when I run the WindowsTerminal.exe "directly" from the loose-file package folder, rather than doing so by the Start menu or another UWP app activation path, a crash occurs at the same place regardless of whether the app is elevated or not.

@ghost ghost added the In-PR This issue has a related PR label Jul 20, 2019
@DHowett-MSFT
Copy link
Contributor

This is a silly and complicated issue. At the heart of it:

Centennial applications that depend on WinRT classes cannot be launched as Administrator. Period. This is a bug, and one that's not likely to be fixed for a while. I'll go into details if somebody wants. 😄

EXCEPT: in 19H1, the app platform team introduced "side-by-side" registration-free WinRT. It's the same thing that makes double-click activation work for Windows Terminal! @metathinker correctly identified this, and it's not misleading at all.

We just have to keep a completely separate list of all activatable runtime classes in sync with the one in the AppX manifest.

This was difficult until 18362, when the manifest tool mt sprouted the ability to generate a manifest fragment from a WinMD file. Suddenly, life became worth living again.

The pull request #2043 finally lands some work that's been on my dev branch for three months. It should fix this entire class of issues, possibly forever.

@DHowett-MSFT DHowett-MSFT added Area-Build Issues pertaining to the build system, CI, infrastructure, meta Product-Terminal The new Windows Terminal. Issue-Bug It either shouldn't be doing this or needs an investigation. Severity-Crash Crashes are real bad news. labels Jul 20, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Jul 20, 2019
@DHowett-MSFT DHowett-MSFT removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Jul 20, 2019
@DHowett-MSFT
Copy link
Contributor

And just to call out: 8ffff8e was not faulty; the existence of a split parallel universe manifest is what was faulty.

@fjpmota
Copy link

fjpmota commented Jul 20, 2019

I had roughly the same problem - when I tried to run the application as an administrator I was getting 2 UAC prompts and then gave an error message. I managed to overcome the problem by installing the app in the administrator user profile. After that I can already launch the app as an administrator from my profile.

@metathinker
Copy link
Contributor

@fjpmota your particular problem sounds like it could actually be issue #1872, not this one.

@fjpmota
Copy link

fjpmota commented Jul 20, 2019

@metathinker you're probably right. the error message matches the one I was getting

@huoyaoyuan
Copy link
Contributor

in 19H1, the app platform team introduced "side-by-side" registration-free WinRT.

I'm very interested in this. @DHowett-MSFT are there any further information available? I can't find it in "what's new in Windows 10 for developers".

@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Build Issues pertaining to the build system, CI, infrastructure, meta Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Tag-Fix Doesn't match tag requirements Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. Severity-Crash Crashes are real bad news.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants