Open Hossy opened 5 years ago
Log file:
2019-05-30 20:32:16 Getting windows user.
2019-05-30 20:32:17 Checking if user is an administrator.
2019-05-30 20:32:17 Initializing the silent update.
2019-05-30 20:32:20 Getting the service user.
2019-05-30 20:32:20 The Plex service is installed. Let's get the user associated with the service.
2019-05-30 20:32:20 The Plex service user: serviceaccount.
2019-05-30 20:32:20 Get the local data folder for Plex.
2019-05-30 20:32:20 Plex local data folder: C:\Users\serviceaccount\AppData\Local
2019-05-30 20:32:20 Verify the updates folder is specified.
2019-05-30 20:32:21 Getting ready to download the latest package.
2019-05-30 20:32:21 Checking for the latest version from Plex.
2019-05-30 20:32:21 The update channel is set for Plex Pass.
2019-05-30 20:32:22 Parsing the information from Plex.
2019-05-30 20:32:23 Creating folder: C:\Users\serviceaccount\AppData\Local\Plex Media Server\Updates\1.15.8.1163-005053bb5\packages.
2019-05-30 20:32:23 Downloading the latest installation package from Plex.
2019-05-30 20:32:28 Checking if the installation package is valid.
2019-05-30 20:32:28 The package is valid. The checksums match.
2019-05-30 20:32:28 Verify the updates folder, C:\Users\serviceaccount\AppData\Local\Plex Media Server\Updates exists.
2019-05-30 20:32:28 Checking to see if updates folder exists.
2019-05-30 20:32:28 Getting the latest update folder.
2019-05-30 20:32:28 Checking for the latest Plex packages folder.
2019-05-30 20:32:28 Get the latest packages file.
2019-05-30 20:32:28 Latest packages file: C:\Users\serviceaccount\AppData\Local\Plex Media Server\Updates\1.15.8.1163-005053bb5\packages\PlexMediaServer-1.15.8.1163-005053bb5-x86.exe
2019-05-30 20:32:29 Checking for server update.
2019-05-30 20:32:29 The server is in use. Waiting for all media to be stopped before performing the update.
Thanks. I will look at this soon and make the necessary changes.
Just wondering if you've had a chance to look at this
I have not yet looked at it as life got a little busy. I am hoping to look at it this weekend.
Just checking back in on this. :-) I really appreciate you writing this tool. It's been a life saver for my system!
Seeing same FYI :)
When using the
-silent
option,silentUpdate.Run()
gets called and only callsCheckIfCanUpdate()
once. IfplayCount
is greater than 0,CheckIfCanUpdate()
merely logs this and exits with success. There is a timer set (_timer
), but it isn't allowed to run as the application exits. There is no loop to recheckplayCount
._timer
appears to be referenced in MainForm.cs, but is not used in SilentUpdate.cs.https://github.com/TechieGuy12/PlexServerAutoUpdater/blob/651d6a431c20634decb3130471b1b631e232dd4d/MainForm.cs#L93
In windowed mode, you're running
_timer
which then callsOnTimedEvent
which callsCheckIfCanUpdate()
. This establishes the loop onWaitTime
becauseCheckIfCanUpdate()
will restart the timer ifplayCount
is greater than 0.In console mode, you have to keep the main thread busy doing something or the process will exit and all Timers will stop running.
My suggestion:
_updateComplete
and set to falseIsUpdateComplete()
function to MediaServer to return_updateComplete
finally
block inMediaServer.Update()
at the very end.if (_server.IsUpdateAvailable())
block ofSilentUpdate.Run()
that checks!MediaServer.IsUpdateComplete()
and sleepsWaitTime
as anelse
toif (CheckIfCanUpdate())