OK, had a few minutes to spare, and the VM was running anyhow, so here we have a batch file that 'should' do it all.
It downloads the bits it needs (including Python and PlexConnect), put's them in the right places on disk, and creates the service.
It's very crude, and simplistic, but works on my VM. Like I've said before I've not got an AppleTV to do any testing, so I leave that upto the people that do have it.
I suppose I should explain usage... Doh
Unzip to any folder you like, and run the InstallPlexConnect.cmd as an Admin. It will make all the folders etc, it will install it all on C:, so edit the script and reg file if needs be.
Also if you already have Python installed, edit the CMD and take out the download and the install sections out, and edit the reg file to point to the right place for the Python.exe file.
EDIT : Just looked into what needs to get it working, seems there is some cert's that are required. I've uploaded some I made into the Certificates.zip file. You need to extract them to the certificates sub folder in c:\PlexConnect to get it all working. They are just generic SelfSSL ones, so can't see why uploading them would be deemed bad, but if it is, let me know and I'll delete them.
The trouble is, with using those certs/keys, someone else could possibly make your aTV to trust his server. So if he is able to point your aTV to his DNS/WebSite, you *might* provide your AppleID or other data to a bad guy.
Not sure how big that risk is - but it is one that is easily avoided.
I used the pyw way to load on startup and it's working fine.
But it's just shut down right now for no reason. In the log it's just shutdown .. No reason for that .. How can I make windows open pyw every time plexconect crashed automatically?
Python stuff has the same flaws as any code, if it get's into a failure it cannot recover from it will die. In the service version you could set the recovery to restart the service, if your starting the pyw using task scheduler the default is to kill it after 3 hours if it's still running (it's designed to schedule tasks after all, and not expecting things to be long running).
To fix TS timeout, just edit the task and goto the advanced properties and disable the kill after x setting.
You could also create a batch file that has the following in it to get it to 'auto restart on fail'
startpyw.cmd - filename
@echo off
call PlexConnect.pyw
call startpyw.cmd
It's not the most elegant way (doing it properly you should have a calling script that uses %errorlevel% to detect failure and relaunch the app) but it will work. (note the startpyw.cmd is the filename, the other 3 lines is the code, obviously change to whatever it's actually called) pop the CMD file into the same folder as the pyw, and then get the task scheduler service to start that. That would then restart the PYW on any failure... simple but crude.
You might also want to check that the PC is not in a DMZ and therefore getting overloaded by external DNS requests.
Agreed, but anyone that has a device like this as a DMZ device is a little bit mad anyhow. Home users have no need for port udp53 to be open, and if you have the device set to be a DMZ device for some reason I would look at making sure you have some form of industrial grade firewall (I recommend MS TMG but upto you) up and running on it anyhow.
Agreed, but anyone that has a device like this as a DMZ device is a little bit mad anyhow. Home users have no need for port udp53 to be open, and if you have the device set to be a DMZ device for some reason I would look at making sure you have some form of industrial grade firewall (I recommend MS TMG but upto you) up and running on it anyhow.
Unfortunately we have seen this before and usually with the less technical users - also broadband "support" for ISP's have a nasty habit of putting machines in DMZ's to test things and then forgetting to undo it afterwards :(
Unfortunately we have seen this before and usually with the less technical users - also broadband "support" for ISP's have a nasty habit of putting machines in DMZ's to test things and then forgetting to undo it afterwards :(
Oh absolutely, I've seen it plenty of times myself. However it's like the batch file/writeup I've done, I would rather try to educate people that are doing these sorts of things, so they understand why/what is the downside's / problems.
This is going to sound 'racists' but I find it's more often than not MAC/iOS/Win7/8 users that make these sorts of mistakes. Apple and MS recently have done far too good a job of hiding the users from how a computer works, and when they do get their hands dirty, there is very little understanding of why/what they are doing.
One click install's are great, but for complex 'systems' it's an issue when your trying to diagnose issues.
Hey, that's why we get paid though, so long live the 'normal' userbase... (oh, and I' have NO problem with people who doe this sort of thing, after all they are learning, and learning is good in any form!)
I am PlexMan! and i decided to wait for Plexiy for windows (It'll come). Why am i telling you this? Cause meanwhile, this is my easy solution, wanted to share with Windows users:
Created a shortcut of PlexConnect.py and putted it in the startup folder (So it'll start with the system). Py files are set to run with python.exe
When computer is up i am minimizing the windows and that's all .. I have the python icon in the "dock" (don't know how they call it ;) ) and that's good enough.
If you dig in google you can probably find an app that will completely hide Python so it'll be completely seamless ..
Thanks everyone!
BTW-writing this again:the way i linked to in the main post of changing the PlexConnect.py extension to PlexConnect.pyw works, it's working and seamless when putting in the startup folder the shortcut but it's crashing after 60 secs. So i am not recommending on that.
Had nothing to do today, so I implemented the service solution of Charlas on my VM. On this VM PlexConnect still ran from the startup folder, but as I don't use that VM regularly as and end-user the cmd box wasn't annoying. But this is even better.
Quick question, if you stop the service, does it actually save the atvsettings.cfg? (just like it does when you CTRL-C the window)?
Going to do this at my parents house too, the service solution seems more stable then the scheduled task solution.
You would be better to follow the official automatically start on the wiki as that does save everything on shutdown.https://github.com/iBaa/PlexConnect/wiki/Win-autostart It’s still running as a service, just using a pythons module to control everything
I just followed the guide, end seemingly everything is working perfectly - only plexconnect doesn't start up. In step 8 you mention 'add the key'. But which key am I to add. Are you referring to the two keys which self-generate via the app you've included in the .zip file or a key generated from this
If it's the latter, I don't know where to put the remaining info. My registry editor will only let me edit 'value' of the key, which leaves me with this line: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PlexConnect] or the binary values, which don't seem to compute with the lines in http://www.nakedcleaner.com/files/PlexConnect.reg.
I'm a bit baffled here.
*edit* I installed plexconnect and python myself, so only the autostart routine was left in the process. Don't know if that's got anything to say in the 'doesn't start up'-part? Of course plexconnect and certificates were working before I installed the instsrv.
I just followed the guide, end seemingly everything is working perfectly - only plexconnect doesn't start up. In step 8 you mention 'add the key'. But which key am I to add. Are you referring to the two keys which self-generate via the app you've included in the .zip file or a key generated from this http://www.nakedcleaner.com/files/PlexConnect.reg
?
If it's the latter, I don't know where to put the remaining info. My registry editor will only let me edit 'value' of the key, which leaves me with this line: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PlexConnect] or the binary values, which don't seem to compute with the lines in http://www.nakedcleaner.com/files/PlexConnect.reg.
I'm a bit baffled here.
*edit* I installed plexconnect and python myself, so only the autostart routine was left in the process. Don't know if that's got anything to say in the 'doesn't start up'-part? Of course plexconnect and certificates were working before I installed the instsrv.
There is actually a fully supported windows service process documented in the plexconnect wiki. (No reg changes needed)
That one I've read before and found it again after searching for it. I thought you were pointing me towards something unlike github, so I didn't think of that in the first place. Problem solved though!