# pyTiVo web configuration can't save changes



## dylanemcgregor (Jan 31, 2003)

I'm sure this is answered some where, but after a few hours of searching and reading, I can't seem to find it.

I'm trying to install pytivo on Win 7 64 bit. I've followed the manual windows install instructions and things seemed to go OK until I started pytivo. The console showed the error "Error: pyTivo.config:Bad ffmpeg path: usr/bin/ffmpeg"

I looked at the web configuration and tried to edit the path to point to the correct windows location, but when I hit save I'm taken to a blank page

http://localhost:9032/tivoconnect

If I then navigate back to the web configuration screen I can see that none of my changes took. What am I doing wrong?

Edit: I see that when I try to save from the web configuration page I get the following output in the console.


```
INFO:pyTivo.beacon:Announcing shares...
ERROR:pyTivo.config:Bad ffmpeg path: /usr/bin/ffmpeg
INFO:pyTivo.beacon:Registering: MyMovies
INFO:pyTivo.beacon:Scanning for TiVos...
INFO:pyTivo:pyTivo is ready.
ERROR:pyTivo:Exception during request from ('127.0.0.1', 52096)
Traceback (most recent call last):
  File "C:\Python27\lib\SocketServer.py", line 582, in process_request_thread
    self.finish_request(request, client_address)
  File "C:\Python27\lib\SocketServer.py", line 323, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Program Files\pytivo\httpserver.py", line 64, in __init__
    client_address, server)
  File "C:\Python27\lib\SocketServer.py", line 639, in __init__
    self.handle()
  File "C:\Python27\lib\BaseHTTPServer.py", line 343, in handle
    self.handle_one_request()
  File "C:\Python27\lib\BaseHTTPServer.py", line 331, in handle_one_request
    method()
  File "C:\Program Files\pytivo\httpserver.py", line 112, in do_POST
    self.handle_query(query, tsn)
  File "C:\Program Files\pytivo\httpserver.py", line 134, in handle_query
    method(self, query)
  File "C:\Program Files\pytivo\plugins\settings\settings.py", line 133, in Upda
teSettings
    config.write()
  File "C:\Program Files\pytivo\config.py", line 67, in write
    f = open(configs_found[-1], 'w')
IOError: [Errno 13] Permission denied: 'C:\\Program Files\\pytivo\\pyTivo.conf'
```


----------



## moyekj (Jan 24, 2006)

As has been stated several times in this thread, don't install under c:\Program Files or c:\Program Files (x86) as those folders have permissions locked down in Win7/Vista. Install somewhere else.


----------



## dylanemcgregor (Jan 31, 2003)

moyekj said:


> As has been stated several times in this thread, don't install under c:\Program Files or c:\Program Files (x86) as those folders have permissions locked down in Win7/Vista. Install somewhere else.


I'm sorry, I searched multiple times, and came across a couple of references to Windows 7, but nothing that talked about what path to install in. Is there a Windows 7 installation guide? I want pytivo to show up in my all programs list.


----------



## moyekj (Jan 24, 2006)

Here are some instructions for Windows install:
http://pytivo.sourceforge.net/wiki/index.php/Windows_Install#pyTivo

(Don't use c:\Program Files though as in the example there)


----------



## dylanemcgregor (Jan 31, 2003)

moyekj said:


> Here are some instructions for Windows install:
> http://pytivo.sourceforge.net/wiki/index.php/Windows_Install#pyTivo
> 
> (Don't use c:\Program Files though as in the example there)


Thanks Mokeyj, those were the instructions I've been following, but I'm still confused as to what is the correct path for Windows 7? I imagine I don't just want to install onto the desktop, right? I obviously don't understand the details of Win 7, but I thought it would have to be in Program Files in order to get a listing in the "Start" menu?

I had pytivo running a number of years ago on an XP machine, but since then every year or so I've spent a day or two trying to figure out how to get it reinstalled, and have always given up.


----------



## moyekj (Jan 24, 2006)

dylanemcgregor said:


> Thanks Mokeyj, those were the instructions I've been following, but I'm still confused as to what is the correct path for Windows 7? I imagine I don't just want to install onto the desktop, right? I obviously don't understand the details of Win 7, but I thought it would have to be in Program Files in order to get a listing in the "Start" menu?
> 
> I had pytivo running a number of years ago on an XP machine, but since then every year or so I've spent a day or two trying to figure out how to get it reinstalled, and have always given up.


 No, you can install anywhere but avoid write protected areas. For example install under:
c:\Users\<you>\pyTivo
Then just make a shortcut to pyTivo.py on the desktop so that you can double-click that to start pyTivo console.


----------



## dylanemcgregor (Jan 31, 2003)

moyekj said:


> No, you can install anywhere but avoid write protected areas. For example install under:
> c:\Users\<you>\pyTivo
> Then just make a shortcut to pyTivo.py on the desktop so that you can double-click that to start pyTivo console.


So I moved the pytivo folder out of program files into user\appdata\roaming and then changed the path to ffmpeg in the config file. When I saved I get this message: "Your settings have been saved to the pyTivo.conf file. However you will need to do a Soft Reset before these changes will take effect.

The configuration page reloads, and the path still shows the default linux path. I do a soft reset, and it still shows the linux path.


----------



## moyekj (Jan 24, 2006)

Make sure you stop any running pyTivo executables (look for python in Task Manager and kill it). You can the edit the user\appdata\roaming\pyTivo.conf file with a text editor to correct the path to ffmpeg. If there isn't a pyTivo.conf then copy pyTivo.conf.dist to pyTivo.conf and edit that. Then double-click on pyTivo.py in that same folder to start pyTivo. Then you can check the web setup to ensure the setting stuck.
I don't know what else to tell you as everything was very easy to configure and install for me and I don't bother trying to run as a service.


----------



## dylanemcgregor (Jan 31, 2003)

Thanks! I think that did it. I had tried manually editing the conf file before, but for some reason it had a lot more info in it, including lots of comments and paths both for linux and windows. Now, after I moved the pytivo folder I opened it up and it was very clear what needed to be edited. I then restarted pytivo.py and things seem to be good to go. Now to test pulling something to the TiVo. I really appreciate your help, as I've been pulling my hair out on this all day.


----------



## pmiranda (Feb 12, 2003)

I'm not exactly sure how I did it, but I managed to get it working in Win7 under Program Files. I think I had to change the ownership and permissions on the .conf file and after a reboot it's working fine.


----------



## dlfl (Jul 6, 2006)

pmiranda said:


> I'm not exactly sure how I did it, but I managed to get it working in Win7 under Program Files. I think I had to change the ownership and permissions on the .conf file and after a reboot it's working fine.


There are two possbile issues running a program in the Program Files or Program Files (x86) folders in Win 7:

1. The program needs to read, but not write to, a configuration file in the runtime folder tree. In this case the issue is editing the config file. If you use Notepad, it won't let you save it to the same name and location. If you use another editor it will pretend to let you save it but is actually saving the modified file as a virtual file in the Users\<username>\AppData\Local\.... folder tree. Then when you run the program you are still using the old unedited version. There are ways to modify the file. For example, copy it to another folder, edit it, delete the original file, then copy the edited version back into the original location. (For which you need administrative privileges.)

2. The program needs to write data into a file in the runtime folder tree. Generally it will not have permission to do so.

AFAIK, pyTivo has issue #1 only. Thus if you manage to edit your .conf file successfully it will run fine. I'm running it that way on my Win7 machine.

vidmgr however, has both issues. It writes a thumbnail cache in the runtime folder tree.

For these types of programs the simple answer is just to install outside those two folder trees.


----------

