How do i start PlexConnect on startup on windows and make it seamless?

UPDATE: SEE THE OFFICIALLY SUPPORTED SOLUTION HERE.

 

 

 

Hi

 

I want to install PlexConnect for friend that uses windows.

I want it to start on system startup and be seamless.

Does this guide this actual? (second comment)

https://forums.plexapp.com/index.php/topic/76738-plexconnect-windows-startup/

 

If not, how do i do that?

 

Thank you!

Plexman,

For windows you do not use plexconnect, that is for apple tv only.  You would need to download the Plex Home Theater and install that.  Once installed you can find the .exe file (normally - "C:\Program Files (x86)\Plex Home Theater\Plex Home Theater.exe" or "C:\Program Files\Plex Home Theater\Plex Home Theater.exe", right click on the .exe and create a shortcut, then copy the shortcut to C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup.  Now when windows is started Plex Home Theater will startup automatically.  In the Plex Home Theater you will have to go to preferences (use the left arrow key to find, in preferences go to Change Preferences for system (gear icon) and configure myPlex to login to their Plex account, the escape key will get you back to the first menu, now under shared content you should see your server content. Also, if you have a media center remote they work nicely with Plex.  

You could always use SRVAny to run Python with the PlexConnect script as it's parameters. That should work, done it with other things in the past (was how I used to run CouchPotato)

Further to my post, just in case you have never come accross SVRAny before (used to use it for everything in the NT4 world... oh the days.....)

Here's the MS guide for the program, http://support.microsoft.com/kb/137890/en-us, install that, get it setup so that Python is the service 'executable' (pythonw.exe I believe it is, if memory serves), then edit the registry, goto hklm\system\currentcontrolset\services\\parameters then edit the AppParameters key and add the path to the script to the end of the python executable (same as you do on the command line). I would also set the AppDirectory to the path to the script itself.

So...... This is what should be in the registry....

"AppDirectory"="x:\\PlexConnect"

"Application"="x:\srvany\srvany.exe"
"AppParameters"="D:\\Python27\\PythonW.exe x:\\PlexConnect\\PlexConnect.py"

Fire up services.msc and start it.... test, if all works well change it to AutoStart (Delay) or Autostart

Profit :) (edit for a little brain fart)

But the plex connect is .py and not .msc

services.msc just launches the service manager (windows component).

I take it your not too ofey with hacking around in windows, I unfortunately at the moment only have my Linux Mint machine with me, so let me fire up my VM and I'll write up a little guide for those that need it.

>> Win service, SvrAny, Registry...

This is great stuff. Is this all that is needed on those machines? That would fit perfectly fit into the neighborhood of /support/OSX.

If you guys are able to hammer out the necessary files (like Registry settings...) to get that automated a little bit, we should add it to github, don't you think?

>> Win service, SvrAny, Registry...

This is great stuff. Is this all that is needed on those machines? That would fit perfectly fit into the neighborhood of /support/OSX.

If you guys are able to hammer out the necessary files (like Registry settings...) to get that automated a little bit, we should add it to github, don't you think?

Does the method i linked too in the first post actual.

I personally used NSSM

http://nssm.cc/

But basically you run PlexConnect once to have python generate the exe files. Then you use NSSM to create a windows service out of the PlexConnect python executable. 

Runs in the background and you can forget about it. 

I personally used NSSM

http://nssm.cc/

But basically you run PlexConnect once to have python generate the exe files. Then you use NSSM to create a windows service out of the PlexConnect python executable. 

Runs in the background and you can forget about it. 

Can you please explain me what do i do with that?

And does the method i linked in the main post still actual?

Thanks so much!

Guide to gettin PlexConnect Setup as a Windows Service.

 

Here's a quick guide to making PlexConnect into a Windows Service, uses SRVAny to run it.

Some notes, SRVAny is not officially supported on Windows Vista/7/8 but works just fine for me in various other things I use it for. Also I don't have an Apple TV, or anything to test the functionality, so I assume you know how to get that running, as I've not even looked into that. I just know it start's and says it's working. Oh there is also NSSM that can be used instead of SRVAny, upto you, the install is pretty much the same either way (except NSSM has a graphical Service Installer)

Compiling PlexConnect Yes, you could compile it, but that just adds complexity to updating/fixing/debugging. At least this way you are running vanilla code, and you can go back to the developer with issues. However compiling does have other advantages if it compiles correctly there is a whole lot less hassle as you don't need the Python runtime installed on the box, but that's not an issue I wouldn't think. 

Requirements :

  • SRVAny - I've put it into a ZIP so you don't need the whole Server2003 ResKit - Download
  • Python 2.7 - On windows I tend to use ActiveState's version, just because it's easier - Download
  • PlexConnect - Just download the ZIP file from the GIT - Download
  • Service Registry File - if you use the same paths etc, this will save you typing it - Download

Guide

  1. Install Python, I've used C:\Python2.7 as the file location, upto you where it goes, just make sure you replace any path names with wherever you have put yours.
  2. Unzip PlexConnect, it will create a Plexconnect-Package folder, rename it to c:\PlexConnect (again upto you where it goes)
  3. Unzip the SRVAny zip and put the two exe files into the PlexConnect folder.
  4. Once you are sure that PlexConnect is running just fine (see ScreenShot of mine working) then continue, if it's not working just running from the shell then make sure you get it going now

     
  5. OK, so we have a working setup (well mine is bitching about certificates or something, but hey), now we need to install the service, make sure your command prompt is an admin one (right click the cmd link, then select start as admin)
    AdminCommandPromt.png
     
  6. CD to c:\PlexConnect and then run instsrv PlexConnect c:\plexConnect\srvany.exe Make sure that it's installed correctly (see screenshot)
    ServiceInstall.PNG
     
  7. Next thing fire up Regedit (just type regedit and press enter on the command line), and navigate to the right section (see Screenshot), add the key, and then the two Data values as highlighted below (Make sure the case is right or if following the guide, then download this reg file and double click it to do step 8) run it).
     
  8. From the command prompt type services.msc that will launch the service's manager, wander down to the service and make sure it looks right, and the startup is set to automatic

     
  9. Click the start button, then OK, and you should now see that the service is running :)
    serviceRunning.PNG
     
  10. And as Elan (and South Park) would say.... Profit :)
  11. Oh if this helped... Click the Like button below :) Thanks .......

>> Win service, SvrAny, Registry...

This is great stuff. Is this all that is needed on those machines? That would fit perfectly fit into the neighborhood of /support/OSX.

If you guys are able to hammer out the necessary files (like Registry settings...) to get that automated a little bit, we should add it to github, don't you think?

See my last post, it's a guide of sorts. I could automate it all, but where's the fun in that :) 

I'll probably do a writeup using NSSM as well.

I could write an Autoit executable to install the service as well. 

Never enough time :)

Wow!

I didn’t quite get step 8 and above.

With what app should I see the window of level 8?

And will it make plexconnect run seamless on system startup?

Wow!
I didn't quite get step 8 and above.
With what app should I see the window of level 8?
And will it make plexconnect run seamless on system startup?

Step 8 is about Regedit, just type regedit on the command line, I've edited step 8, does that make more sense?

At my parents house I just created a scheduled task on my fathers PC (which is always on, Win 7) which starts @ logon and runs under a different account. That way you don't see the actual command prompt, because it's in the other users' environment.

Furthermore I created a batch file on his desktop which he can launch which kills the python process, shuts down the task and re-runs the task. He can use this batch file if PlexConnect for whatever reason hangs or whatever. Tested it, and it works. But he never had the need to use it up until now (asked him a week ago). Seems PlexConnect is getting more stable now ;-)

Guess there's more ways to it. This one seems very nice too!

>>Seems PlexConnect is getting more stable now ;-)

It has been unstable?

:-D

How did you do that?

Can anyone please tell me if the way I linked is still actual

>>Seems PlexConnect is getting more stable now ;-)

It has been unstable?

:-D

Haha, in the earlier versions I sometimes had to restart it, cause I was getting a "Trailers unavailable".. Don't know why, but it's hasn't happened in a long time.

How did you do that?
Can anyone please tell me if the way I linked is still actual

Not to sound unfriendly, but I'm not going to list out the steps for you. Just google it dude, it's pretty straigh-forward.

http://www.sevenforums.com/tutorials/67503-task-create-run-program-startup-log.html

Actually mine doesn't run @ logon, but @ startup. So if my dad turns on his desktop he doesn't even need to log in, the program runs @ boot of desktop, not @ logon.

I guess the srvany does the same, as it's running as a service and that also starts before logging in. I'm actually going to use this I think, it's even more clean then the scheduled task thingie.. I can even rewrite the batch file I was talking about earlier so that it doesn't re-run the task but just stops and starts the service. Good stuff!

Would be even greater if Baa could integrate this in Github. Actually, thinking about that, how about taking it to a whole other level? Say you integrate the python stuff. Like, compile it with the rest of the code. (don't know if that's possible) That way you could make a binary/installer out of it which just installs plexconnect to a given folder and installs a service which calls the plexconnect executable. Or, do it the way PS3 media server does it. With a GUI which can be minimized to tasktray?

I don't know how hard that is, but it would be way cool :)

http://www.logix4u.net/component/content/article/27-tutorials/44-how-to-create-windows-executable-exe-from-python-script

/edit

Oh, and BTW, the post charlas made really deserves a sticky!

Why thank you FreakNL, I've managed to get a bit more spare time, so may put a few guides together for things people seem to have problems with. I've done a few on my blog (www.nakedcleaner.com) but I suppose popping some in here wouldn't be a problem.

If anyone has any specific requirements etc, just shout, tis a friendly place the Plexapp forums.