configuration file is overwritten on system restart

Windows specific discussions
Post Reply
brodel
Posts:10
Joined:Sat Sep 08, 2007 6:35 am
configuration file is overwritten on system restart

Post by brodel » Sat Sep 08, 2007 6:48 am

Hello,

I have Windows XP prof with SP2. I have upgraded from latest TwonkyMusic version to TwonkyMedia Server 7.4.

Since this upgrade, the configuration file "twonkyvision-mediaserver.ini" is overwritten with a default file on every system restart.

I am using the system service, because I want the server to be started even if I don´t log on. So I always have to stop the service, copy a backup over the file, and then restart the service.

Do you have a hint?

Regards
Thorsten

therathouse
Posts:5
Joined:Sun Feb 04, 2007 9:49 pm

Post by therathouse » Sat Nov 10, 2007 10:52 am

I have this problem too but it does't seem to be tied to server restarts...however if it helps when I checked the config I saw that the search folder was back to c:\OurMusic which I think is my standard but no one elses so I searched, and along side TwonkyVision-MediaServer.ini I found TwonkyMedia-default.ini which contained the above path.

So my latest theory is that in some circumstances (as yet unknown) it overwrites the TwonkyVision-MediaServer.ini with the TwonkyMedia-default.ini . So I set up my server again, re-added the licence and paths then copied TwonkyVision-MediaServer.ini over the top of TwonkyMedia-default.ini .

To track if this happens I edited the text at the top of the TwonkyMedia-default.ini to see if this appears in the TwonkyVision-MediaServer.ini .

The only problem is that I cannot force this to happen, I tried service restart (from admin tool and twonky config page tool), server restarts, PC restarts, PC power off all seems OK so I'll post again to let you know the outcome.
Andy
Netgear MP101s, Roku M1001, Salling Clicker (on N95) and Media Monkey

Rakuda
Posts:3
Joined:Thu Aug 30, 2007 10:59 pm

Post by Rakuda » Sun Nov 18, 2007 4:18 am

They have had this problem for along time. My fix is to keep entering my key. I have to do this about every week

skotl
Posts:27
Joined:Sun Jun 18, 2006 11:52 pm
AV Hardware:uPNP Servers running on Ubuntu, plus random clients including Netgear 101 and Windows 7 Media Player
Location:Edinburgh, Scotland
Contact:

Post by skotl » Wed Jan 16, 2008 12:03 am

Hi there,

apologies if this is a little late, and if it may be too basic a response...

When an application runs as a service, it runs in the context of the user that it is configured for. Hold this info in your head for a sec while I move to how INI files work...
INI files are not typically accessed directly; instead they are accessed through a bunch of API calls (for example ReadProfileInt()). When these calls execute, they first look for a file in the running user's context \ Application Data.
For example, if you (John) run a program that tries to read an INI file, then the default location for this INI file is c:\documents and settings\john\application.ini

When an application runs as a service, then it is running under a specific user contect which, almost invariably, is not you...
If you run "services.msc" you can spot your services and find out which user context it is running under (by double clicking on it and going to the Logon tab).
If the Logon Context is the local system account, then the path to it's ini file is "C:\Documents and Settings\LocalService\Application Data

So, the first step (and bear in mind that I am talking generically here, rather than Twonky specific) is to ensure that the INI file you are editing is this one.

OK - that was INI files 101. An application can also specify its own INI file and the easiest way to do this is to specify an INI file in the application's startup folder.
If this is what Twonky is doing then, potential bug aside, you can still use this info to your advantage. Remember that the application (Twonky) is running in a specific user context. If it is running, for example, as the Local System Account then you know that this user "SYSTEM" should not be allowed to overwrite your INI file.
This is actually pretty easy; find the INI file under the Twonky folder, right click on it and click on Properties and Security, then remove the security options for SYSTEM and then add a new entry for SYSTEM, allowing it Read, List Folder Contents and Read & Execute permissions.

One final fly in the ointment; you may not see a Security tab on the file properties dialog. If this is the case, refer to http://support.microsoft.com/kb/301195 for more info.

Oh, and this may be a genuine Twonky bug and so, ITIL-speaking, the above is a workaround.

S.

therathouse
Posts:5
Joined:Sun Feb 04, 2007 9:49 pm

Post by therathouse » Wed Jan 16, 2008 8:24 am

Just to say that my server has not "deregistered" since I copied TwonkyVision-MediaServer.ini into TwonkyMedia-default.ini.

I changed the comments in the default version and these have never reappeared in the live version so I can only assume that on odd occasions the settings are read from the default ini file and written back to the live one.

Following the last post I also searched my hard drives for another ini file but I found none except the one in the application directory, I also checked the registry as I have seen ini files replicated in there before as well, but nothing...so good idea, but doesn't seem to apply in my particular case.

Perhaps the Twonky development team can shed a little light on this for us, such as searching the code for occasions where the default ini file might be read ?

Either way mine is still working so maybe if others could try the copy technique and let people know if it works for them, we may have a workaround.
Andy
Netgear MP101s, Roku M1001, Salling Clicker (on N95) and Media Monkey

Post Reply