-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
Fallback to run as admin after install, if running PT as user not possible #16089
Conversation
56d2f2b
to
6b6edf5
Compare
src/runner/main.cpp
Outdated
restart_same_elevation(); | ||
result = -1; | ||
Logger::warn("Scheduled restart failed. Trying restart as admin as fallback..."); | ||
restart_elevated(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are trying to restart elevated? Seems strange that it would work for the issue people are having. How about doing a debug build to verify this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested it locally. The issue can easily be reproduced if you just try to install PowerToys on non-admin user.
The issue is happening because how we're trying to run non-elevated from elevated admin owned process. So we try to run non-elevated, if it fails, run elevated as it was working before.
Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com>
Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com>
Co-authored-by: Andrey Nekrasov <yuyoyuppe@users.noreply.github.com>
c14ddcf
to
db6baf9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Summary of the Pull Request
What is this about:
What is included in the PR:
How does someone test / validate:
Quality Checklist
Contributor License Agreement (CLA)
A CLA must be signed. If not, go over here and sign the CLA.