INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: I Figured Out (One Reason) Why Installing MC Always Wants to Reboot Sometimes!  (Read 881 times)

glynor

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 19608

So... Something that has been bugging me (and others here) for a LONG time is that on certain computers, it seems like MC gets into a state where when you go to install a new version, it always seems to want to reboot the system before it completes the install.

Well... I got lucky, and I figured out a reason that is simple to solve.  Here's some background:

On my HTPC, I've been having a problem lately (for the past 6 months or so solid, it seemed) where basically every single time MC wanted to install an upgrade, it has to reboot the PC when it completes.  I didn't know why.  I've tried all sorts of things to fix it.  And, worse, occasionally it wouldn't require a reboot, but these times seemed equally random.  I couldn't correlate any settings in MC or anything to the times when it would or would not require a reboot.

The thing is, I have a bunch of machines, with nearly identical configurations in most cases (backups made and restored from one to the other) and other machines didn't exhibit the behavior, or only did so occasionally.

Well, I figured one reason out, quite by accident.

In almost all cases on my HTPC, I install an update to MC via one of two means:

1. MC prompts that an update is available, and I do it through the MC interface in the Action Window.
2. I'm browsing in my web browser on Interact from the HTPC and I download a new version and install it.

My HTPC does NOT run a Library Server in the background, but it is a HTPC so MC is basically always running on it whenever the PC is awake and I'm using it.  So, whenever I run the updater, it almost always has to show the "MC is running, do you want to shut it down automatically" prompt.  That's expected, and it works fine on all of my other computers.

But, just the other day, I was on Interact in my web browser on the HTPC and there was a new build and so I downloaded it and was going to install it.  For no particular reason whatsoever, I decided to close MC itself manually before running the installer.  Again, MC doesn't run the Media Server on this machine, so closing MC should actually close it for real.

A few moments later I ran the actual installer.  And, I got the "MC is running, do you want to close it to continue the install?" prompt.  I thought, oh, MC is still shutting down (sometimes it takes a few seconds to close fully) so I hit cancel waited a second and tried again.  Same prompt.  Hmmm... Okay, I guess I'm being impatient.  I almost just clicked okay to shut it down but some little voice told me this was something interesting.  So I walked away to get a sandwich or something.  This wouldn't normally happen.  I usually just click OK through that prompt whenever I'm doing an install, because (like I explained above) MC is usually running when I start this process.

I wander back a few full minutes later and run the installer again, expecting it to "just work" this time.  But, again, it prompted that MC was running.  Huh?  Oh come on, it has been minutes now.  What is MC doing in the background?  MC wasn't visible in the taskbar of course, and I checked the tray (just because I was confused) and, no, I hadn't accidentally enabled the Media Server in a drunken bumble of some kind.

Crud, I thought, is MC crashed and stuck?  Out comes Process Explorer.  And, there, sitting in the nested list of processes in Process Explorer, is Media Center 20.exe...

With firefox.exe running "beneath" it as a child process.

I closed Firefox on the PC and then ran the installer again.  The Media Center 20.exe process vanished in Process Explorer and the installer runs and no "shut down MC" prompt.  I ran through the installer... Hmmm, no reboot prompt this time!  Been a while since the HTPC has been able to install MC without rebooting.

Immediately I thought... Why is MC running Firefox as a child process?  And then, it dawned on me.  Links.

It was just about 6 months ago that I set up a nice set of Links on my systems.  I use these a LOT on the HTPC.  After we watch a show or whatever, if my wife and I are discussing "what other stuff was that actress we remember vaguely in" or whatever?  Pop up IMDB, TheTVDB, or whatever.

Firefox is running a LOT on my HTPC.  In fact, when I'm installing a new build, it is open almost every time, because I come to Interact (often while it installs) to look around and see what's going on.  Who knows how this actual session of Firefox got started originally in most cases?  But apparently, I'm launching new browser windows via the Links in MC a LOT.  Almost all the time, it seems.  This isn't surprising since Firefox will often run for days or weeks at a time on the HTPC, just minimized when not in-use (because I'll have 15 tabs open I don't want to lose and just minimize it).

So.... If you're getting prompted to reboot when you install new versions of MC a bunch and it is driving you batty, try closing any open web browsers on your computer.  If you have MC set to launch the browser externally for these or other purposes, and you tend to leave the web browser sitting open and running on your computer a bunch... I think it is the Web Browser that is keeping Media Center's processes running (at least some of them), and so when it installs, it can't copy over the in-use pieces.
Logged
"Some cultures are defined by their relationship to cheese."

Visit me on the Interweb Thingie: http://glynor.com/

InflatableMouse

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3978

Interesting.

Correct me if I'm wrong but I don't think MC has to be the parent of a spawned process, it could spawn a new process "stand alone", right?

So, if it spawns Firefox as a separate window and not inline in MC itself, it should (if possible) spawn them as stand alone processes and not as child processes. This would prevent that issue with reboots being required.
Logged
Pages: [1]   Go Up