Tuesday, October 21, 2008

Recover Gracefully from an HTPC Application Crash

If you use a Home Theater PC to run your living room entertainment you no doubt are focused on keeping the PC-part of the HTPC behind the scenes.  Despite all your efforts to avoid the dreaded computer operating system rearing its ugly head, on occasion you’ll no doubt experience a program crashing now and then.  My goal today is to show you an easy way to gracefully (as gracefully as possible at least) recover from an application crash in XP or Windows Server 2003.

There are two simple steps to the process – each of the steps address the crash itself and automatically restarting the application from that crash.
 
PART 1: DISABLING THE WINDOWS XP ERROR REPORTING NAG MESSAGE 

When an application crashes using Windows XP as your operating system, you usually get the following annoying message:

MS Error Message

This less than useful message causes the following problems for the HTPC user:
  1. First, it tells the user that they are using a crash-prone, buggy HTPC.  WAF (Wife Acceptance Factor) and user acceptance immediately goes through the floor.
  2. Worse then the above, this message requires you to pull out either a mouse or keyboard to continue.  To maintain the premise that this is a 10-foot interface, we DO NOT want to use anything other than a remote control unless it’s for a cool, extra feature like web browsing on your TV right?
  3. Finally the error message does absolutely nothing for the user.  It is one of those things people hate about the Microsoft OS and we want to eliminate it.
SO HOW DO YOU DISABLE THE WINDOWS ERROR REPORTING MESSAGE?
In Windows XP/2003 do the following:
  • Go to Control Panel.
  • Select Performance and Maintenance
  • Select System
  • Navigate to the Advanced Tab

error reporting

error reporting3

  • Select Error Reporting                  
  • Select the "Disable Error Reporting" radio box (I leave the "But notify me when Critical Errors Occur" message selected.



PART 2: AUTOMATICALLY RESTARTING THE “CRASHED” APPLICATION
Some applications may restart on their own after an application crash, but others might not.  If that application happens to be integral to your HTPC experience, it becomes more then an annoyance.  Now that we have the windows error message disabled in step one, we can focus on having the app automatically restart.
I ran across a nice freeware utility app via MyDigitalLife called “Application Monitor” that watches for any programs of your choosing to monitor for a crash and even restarts the application as soon as a system crash is detected.
HOW TO INSTALL APPLICATION MONITOR

  • Download and extract application monitor from the website
  • Run ApplicationMonitor.exe
  • Select “Add” to add a program to monitor & browse to the program file (file must have one of the following extensions: *.exe, *.bat, *.scr and must be lower case)appmonitor1
  • Enter the program name and browse to the file location.  You can change the frequency that the program checks for the file to be running in the “check every” box.  The default frequency is 2 minutes with the minimum being 30 seconds.

appmonitor

  • Select the checkbox next to the application to enable monitoring

appmonitor2

  • If you want to monitor that program from afar, you can select Tools>Settings and insert your email address and get an auto e-mail notification any time there is an error.  In addition, all events are output to a log file for later review.

appmonitor3

The Application Monitor makes a very nice troubleshooting program for programs that are crashing on occasion.  I would also consider using it for any HTPC-related program, web or mail server or other client applications.

Program Requirements:

  • Windows 98, NT4, Windows 2000, Windows XP or Windows Vista
  • Microsoft .NET Framework 1.1 or higher


Get the latest version of the donationware Application Manager

MAP YOUR REMOTE TO START PROGRAM

My final method to handle the restart after crashing is specifically meant for HTPC users.  If you HTPC software crashes and you have remote control in hand, make sure you have a command mapped using girder or eventghost to that HTPC program.  I’ve done this with BeyondTV and SageTV for those moments when I needed to start the HTPC front-end program with a press of the remote.  Works every time.