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

Fix/Refactor windev Admin Elevation #2683

Merged
merged 4 commits into from
Sep 10, 2024

Conversation

Marterich
Copy link
Contributor

@Marterich Marterich commented Sep 5, 2024

Type of Change

  • Bug fix
  • Refactor

Description

Changed the auto elevation logic to use the same URLs whether windev is called as admin or not.
(previously a static URL was used when the shell wasn't run as admin)

Issue related to PR

@MyDrift-user
Copy link
Contributor

MyDrift-user commented Sep 5, 2024

@Marterich it was done because otherwise when launchin the winutil dev release it will elevate and run the latest full release instead of the originally launched dev release. There might be a better fix but that was mine at the time.

@Marterich
Copy link
Contributor Author

@Marterich it was done because otherwise when launchin the winutil dev release it will elevate and run the latest full release instead of the originally launched dev release. There might be a better fix but that was mine at the time..

Allright, I'll take another look

@Marterich Marterich marked this pull request as draft September 5, 2024 20:17
@MyDrift-user
Copy link
Contributor

If you only want to fix the attached issue, you may remove/fix the $arglist bc the rest should work fine

@Marterich
Copy link
Contributor Author

If you only want to fix the attached issue, you may remove/fix the $arglist bc the rest should work fine

I updated the logic and the PR Description. Now the same URLs are being used, whether /windev is called as a privileged user or not.

@Marterich Marterich marked this pull request as ready for review September 5, 2024 21:06
Copy link
Contributor

@MyDrift-user MyDrift-user left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, thanks :)

@MyDrift-user
Copy link
Contributor

wait, shouldn't you escape Invoke-RestMethod under $script = Invoke-RestMethod $url?

@Marterich
Copy link
Contributor Author

wait, shouldn't you escape Invoke-RestMethod under $script = Invoke-RestMethod $url?

This is not really necessary because Powershell is not as strict as bash for example, meaning, if Invoke-RestMethod is a known module/function it gets directly invoked. Winutil gets downloaded and stored in $script and later passed as a string to iex

@Marterich Marterich changed the title Revert Admin Elevation Fix/Refactor windev Admin Elevation Sep 6, 2024
@ChrisTitusTech
Copy link
Owner

Fantastic way of elevating it properly. Thanks @Marterich

I haven't forgotten about the Choco tweak, I just wanted to show that on stream when I merge it.

@ChrisTitusTech ChrisTitusTech merged commit ff363d6 into ChrisTitusTech:main Sep 10, 2024
1 check passed
@ChrisTitusTech ChrisTitusTech added the skip-changelog Skip Change Logs label Sep 10, 2024
@Marterich Marterich deleted the fix-windev branch October 3, 2024 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-changelog Skip Change Logs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken Run as admin (windev)
3 participants