PlexServerAutoUpdater icon indicating copy to clipboard operation
PlexServerAutoUpdater copied to clipboard

Exit Code 0 Returned When Running Silent as Non-Administrator

Open Hossy opened this issue 6 years ago • 7 comments

https://github.com/TechieGuy12/PlexServerAutoUpdater/blob/651d6a431c20634decb3130471b1b631e232dd4d/Program.cs#L73

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 avatar May 31 '19 00:05 Hossy

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

Hossy avatar May 31 '19 00:05 Hossy

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

TechieGuy12 avatar May 31 '19 01:05 TechieGuy12

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.

Hossy avatar May 31 '19 14:05 Hossy

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.

TechieGuy12 avatar May 31 '19 14:05 TechieGuy12

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 avatar May 31 '19 14:05 Hossy

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

Hossy avatar Jul 09 '19 14:07 Hossy

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

Hossy avatar Feb 05 '20 14:02 Hossy