-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 WinUtil's self-elevation when running windev.ps1 without administrator #2800
Fix WinUtil's self-elevation when running windev.ps1 without administrator #2800
Conversation
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.
Hello there @Cryostrixx ! 😊Nice work.
I left you a couple of suggestions to take into consideration.
Hello, @momcilovicluka! Thank you for the feedback! I wanted to let you know that I plan to retain a small amount of my original comments and code, but I’m currently working on adding your suggestions to the script. |
Hello, @momcilovicluka! I implemented your changes, thanks so much for the feedback! |
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.
Hi! Good work and fast response. I tested running it with config and run argumetns and it is working. Also tested with old version and without winutil.ps1 in temp, and i saw no problems. Only thing i couldn't test is if pre-release is being detected correctly due to there being no pre-releases hosted.
Other tnan that, LGTM! 😊
Hello, @momcilovicluka! I've finalized the PR with four out of the five changes you suggested. If the changes look good to you, could you please approve them? I've really appreciated all of your feedback so far and want to make sure everything is correct. |
Hi @Cryostrixx 👋. Thank you for the kind words, you are really wholesome. I turned of the pc for the day as it's nighttime in my timezone, but I'll make sure to review first thing in the morning. I assume you already tested the changes in different ways to ensure everything is working correctly, so you can work on something else in the meantime. I'll review in about 8 hours. |
You're correct, I did that testing during development, I had to simulate the pre-release condition for the testing but considering the rest of the functionality was tested and verified as working it's safe to say pre-releases would work as well. |
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.
Hi! I just tested it for safety sake and it seems to be working fine. Given that you already tested it thoroughly and i have no complaints about the code, you implemented everything very well.
LGTM!
Contributor Note
I decided to close this PR because, after waiting a significant period without any feedback or review, it became clear that my contributions weren't valued. Seeing other PRs prioritized over mine reinforced this feeling, and I’ve chosen to step away from contributing. I hope the review process improves to be more inclusive of all contributors, regardless of their contributor status.
PR status: Permanently closed and won't be reopened. Reason: The head repository has been deleted and won't be restored.
Type of Change
Description
Problem
WinUtil Dev currently doesn't launch correctly when run as a non-elevated user.
The following error occurs when running
irm https://christitus.com/windev | iex
without elevation:Changes
Summary
windev.ps1
to useInvoke-RestMethod <url> -OutFile <file_path>
instead of usingInvoke-RestMethod
directly.windev.ps1
to useStart-Process
instead ofInvoke-Expression
when launching the downloaded WinUtil script.windev.ps1
to no longer re-download WinUtil every time; now it only re-downloads when releases are modified.Testing
I conducted thorough testing using both local execution and remote execution.
For remote execution, I used npm's
http-server
package to serve the script's directory with the following command:http-server -p 4300 -c-1 C:\Users\#####\NoSync\Projects\Cryostrixx\forks\winutil\.staging\fix-windev-admin-elevation
.Results
Local Execution
Command:
.\windev.ps1
Result: WinUtil launches successfully with no errors.
Command:
.\windev.ps1 -Config "C:\Users\#####\Documents\Configs\winutil.json"
Result: WinUtil launches successfully and imports my config with no errors.
Remote Execution
Command:
iex "& { $(irm http://127.0.0.1:4300/windev.ps1) }"
:Result: WinUtil launches successfully with no errors.
Command:
iex "& { $(irm http://127.0.0.1:4300/windev.ps1) } -Config 'C:\Users\#####\Documents\Configs\winutil.json'"
Result: WinUtil launches successfully and imports my config with no errors.
Impact
Get-WinUtilReleaseTag
function to return the latest matching tag for WinUtil.stable
andpre-release
tags, falling back to thelatest
tag when no releases are found.Get-WinUtilReleaseURL
function to return the download URL for the latest release of WinUtil.stable
andpre-release
URLs, and uses thelatest
release URL when no releases are found.Get-LatestWinUtil
function to download WinUtil towinutil.ps1
in the$env:TEMP
directory.Get-WinUtilUpdates
function for updates, ensuring WinUtil is only re-downloaded when modified:Start-LatestWinUtil
function for smoother launching of WinUtil using the appropriate process:Windows PowerShell/PowerShell Core running in Windows Terminal
.Windows PowerShell/PowerShell Core running as a standalone app
.-Run
,-Config
, and-Debug
correctly.Issues related to PR
Additional Information
None.
Checklist