Restrict access to Mediaportal.exe.config (1 Viewer)

utokallegba

Portal Pro
January 27, 2010
123
2
MediaPortal Version: 1.1.0 RC1
MediaPortal Skin: StreamedMP 1.0.0.1067
Windows Version: Windows 7 x64
CPU Type: Intel Core 2 Duo E8400 @ 3.00 GHz
HDD: Kingston SSDNow V-Series 64GB
Memory: G.Skill DIMM Kit 4GB PC2-8000U CL5 DDR2-1000
Motherboard: ASUS Rampage Formula
Video Card: ATI HD5750
Video Card Driver: Catalyst 9.12 & Realtek HDMI 2.39
1. TV Card: FloppyDTV
1. TV Card Type: DVB-C
1. TV Card Driver: latest
MPEG2 Video Codec: CyberLink PowerDVD9
MPEG2 Audio Codec: ffdshow
h.264 Video Codec: CyberLink PowerDVD9
TV - HTPC Connection: HDMI


Hello.


Whenever a PC that is running MediaPortal loses power (e.g. through an outage or a hard reset), it will break the Mediaportal.exe.config file (the file will be empty after the power loss).
MediaPortal does not startup with an empty .exe.config file though, so it'll give you an error. Simply replacing the new (empty) Mediaportal.exe.config with an backup of the original file will fix the problem and MePo will start again.

At the moment I am using a bit of a workaround to make sure MePo starts no matter what: I have a batch file in my Windows auto startup which replaces the current Mediaportal.exe.config with a backup version of it (the file will be replaced no matter if it's broken or not) and then starts MediaPortal.
This works fine for the time being, but it's not an ideal workaround, since it takes some time until the file is overwritten (~ 1 sec) and MePo is started.

So I thought maybe one could prevent the .exe.config from breaking in the first place, hence a workaround wouldn't even be necessary? Like, restricting write access to the file, so it couldn't be emptied by MePo (or who/whatever).

Is this possible? Has anyone tried that? Please let me know!


Thanks in advance!


Best regards.
 

jsimmons

Portal Pro
December 6, 2008
126
2
Home Country
United States of America United States of America
Unless MediaPortal is doing something REALLY stupid, the config file should always contain the last data written to it, regardless of the way MediaPortal (or the system) is shutdown. It sounds more like a problem with operating system configuration, interference from other (anti-virus?) software, or even a hardware problem rather than with MediaPortal.
 

utokallegba

Portal Pro
January 27, 2010
123
2
Unless MediaPortal is doing something REALLY stupid, the config file should always contain the last data written to it, regardless of the way MediaPortal (or the system) is shutdown. It sounds more like a problem with operating system configuration, interference from other (anti-virus?) software, or even a hardware problem rather than with MediaPortal.
If you don't mind, you could test it. Make a backup of the .exe.config before though.
 

dir

MP Donator
  • Premium Supporter
  • August 30, 2006
    408
    36
    Home Country
    Afghanistan Afghanistan
    In support of the OP, I've had that happen on a number of occasions, but it's been quite some time since it did. I think it last happened over a year ago and I was probably still on XP. It only happens as the OP says (power loss or similar) so the file would have been open for write access and not closed properly.

    I might have cleaned up my system a bit and ensured that I'm not powering off it unexpectedly. I configured it for suspend, configured the power button to not do an immediate shut down, and possiblly ensured that the hard drive isn't caching writes (Device Manager, double-click on hard drive and check the config under all the tabs).

    The problem with a script to copy across a backup is that any changes to MP might be lost. It's better to try to prevent the underlying issue (i.e. stop the PC from powering off). Keep a backup for the rare time it happens and manually invoke the script on those occasions.
     

    thesystemera

    Portal Pro
    May 26, 2008
    810
    22
    43
    Auckland
    Home Country
    New Zealand New Zealand
    I have had this problem as well on more than one occasion... Took me a while to work out, but I can confirm that this is correct, it does seem to corrupt some times when the system dies and a replacement is required..
     

    erron

    Portal Member
    April 14, 2009
    13
    4
    yep, had the same problem myself yesterday, fixed it by copying data from configuration.exe.config into the mediaportal.exe.config (i didnt have a backup)

    im also on Win7 with RC1
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    I'm quite sure that MediaPortal itself wont use the .exe.config file. So, most likely we are dealing with file system corruption (lot of repost say that they have had BSOD) or by in the .NET framework.
     

    Users who are viewing this thread

    Top Bottom