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

Exit Code 0 Returned When Running Silent as Non-Administrator #33

Open
Hossy opened this issue May 31, 2019 · 7 comments
Open

Exit Code 0 Returned When Running Silent as Non-Administrator #33

Hossy opened this issue May 31, 2019 · 7 comments

Comments

@Hossy
Copy link

Hossy commented May 31, 2019

Exit(ERROR_ACCESS_DENIED);

psupdate.exe -silent && echo success || echo fail returns success in a non-elevated command prompt on Windows Server 2012 R2.

The contents of the log file are:
2019-05-30 19:01:46 Getting windows user.
2019-05-30 19:01:46 Checking if user is an administrator.

@Hossy
Copy link
Author

Hossy commented May 31, 2019

Additionally, I would like to suggest moving line 61 and line 70 outside the if (!isSilent) block so the error can be logged.

@TechieGuy12
Copy link
Owner

Thanks for the catch. The fix should be available in 0.1.8.6-beta.1.

@Hossy
Copy link
Author

Hossy commented May 31, 2019

0.1.8.6-beta.1 fixes the logging issue, but the exit code is still 0.

C:\Program Files (x86)\PlexServerAutoUpdater>psupdate -silent

C:\Program Files (x86)\PlexServerAutoUpdater>echo %errorlevel%
0

C:\Program Files (x86)\PlexServerAutoUpdater>psupdate.exe -silent && echo success || echo fail
success

psupdate.exe -silent && echo success || echo fail returns success in a non-elevated command prompt on Windows Server 2012 R2.

@TechieGuy12
Copy link
Owner

The release [0.1.8.6-beta.2]https://github.com/TechieGuy12/PlexServerAutoUpdater/releases/tag/0.1.8.6-beta.2 should fix the errorlevel issue.

@Hossy
Copy link
Author

Hossy commented May 31, 2019

Error code is still 0.

C:\Program Files (x86)\PlexServerAutoUpdater>psupdate -silent

C:\Program Files (x86)\PlexServerAutoUpdater>echo %errorlevel%
0

C:\Program Files (x86)\PlexServerAutoUpdater>psupdate.exe -silent && echo success || echo fail
success

@Hossy
Copy link
Author

Hossy commented Jul 9, 2019

Just wondering if you've had a chance to look at this

@Hossy
Copy link
Author

Hossy commented Feb 5, 2020

Just checking back in on this. :-) I really appreciate you writing this tool. It's been a life saver for my system!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants