Fog Creek Software
g
Discussion Board




Parameters to check at startup

What are some system Parameters that you check when your program is loaded? 

I check to see if Windows was booted in Safe Mode and I check to make sure there is a mouse attached to the system and also to make sure only one instance of the program is running. 

Are there any other system (or other) parameters that you guys have learned (from experience) to check?

I realize some things are program dependent, but I'm looking for OS parameters that give clues as to potential problems.

Dave B.
Sunday, October 12, 2003

I check the amount of free memory and the OS version in addition to the 3 parameters you mentioned.

Chuck
Sunday, October 12, 2003

We always check the IE version to make sure it's 5.01 or later, both because we rely on some IE components and because upgrades to IE also included upgrades to various system components and common controls. Anything older than IE 5.01 and you're dealing with a computer that hasn't been updated in a long time which is likely to have all kinds of dumb issues.

Joel Spolsky
Sunday, October 12, 2003

Although this is program specific we check the Hard Drive Free Space and the Processor Make and Model.  We also check to ensure that the program is started from a hard disk drive (i.e. not a removable drive).  You could also check to ensure a keyboard is installed, but i don't believe IBM PC's will boot without one anyway, though you could still  do so to check the type of keyboard installed if you need that information.  Personally, I think it just makes sense to check most if not all of the things listed in this thread, especially for shrinkwrapped applications.

x
Sunday, October 12, 2003

You may also check for a printer that is physically connected to the machine and maybe if the machine is connected to a network. (Though I don't have the code to do either.)

x
Sunday, October 12, 2003

You can check that the computer power is on and that the user is alive.

Here is the code (I put it in the public domain):

int computerPowerIsOn()
{
      return 1;
}

int userIsAlive()
{
      char c;

      printf("Are you alive? (Y/N): ");
      c=getchar();
      if (toupper(c)=='Y')
            return 1;

      Call911("A zombie is hacking me");
      return 0;
}

FireMode (I was kidding)
Sunday, October 12, 2003

"You could also check to ensure a keyboard is installed, but i don't believe IBM PC's will boot without one anyway, though you could still  do so to check the type of keyboard installed if you need that information."

Every PC I've had for, well, at least a decade has supported starting without a keyboard attached. Servers for sure very rarely have keyboards attached when they're booted, and keyboards (AT, PS/2, or USB) can be attached at any time and will function normally.

Brad Wilson (dotnetguy.techieswithcats.com)
Sunday, October 12, 2003

Why do you care whether a keyboard and/or mouse is attached?

What possible difference could it make to youre program? Especially given you can emulate a mouse with the keyboard with functionality built into windows, and I'm pretty sure you can do the opposite with 3rd party software.

Sum Dum Gai
Sunday, October 12, 2003

I *hate* software that tries to check the system before running to make sure everything fits its definition of OK. 

I used to have software that wouldn't run if a printer wasn't attached even though printing wasn't something I'd ever want to do from this.  My conclusion was that the programmers were too lazy to make sure their printing code didn't break when there was no printer.  Since I had a laptop, this was a problem for me.  Not surprisingly, that company is not in business today. 

Another example of 'helpful' system checks is the classic story of the NT check that was common in games when NT didn't support higher versions of DirectX.  Typically, a game install would check the OS and prevent installation on NT.  Then Microsoft came out with the next version of NT (Windows 2000) and it did support higher versions of DirectX and suddenly you couldn't play games on your system simply because so many game developers did such a stupid system check and offered no way of bypassing it. 

What good is something like checking for a mouse? 

SomeBody
Sunday, October 12, 2003

>> "What good is something like checking for a mouse?"

The "mouse check" and most (but not all) of my other checks are simply made for support reasons.  I have learned that you cannot trust what the customer is telling you (over the phone).  They could be doing what you ask and telling you what they see on the screen or they could be playing solitaire and totally making things up.

All of my checks are "silent".  The program continues to function normally and the user is never informed that these checks are done. 

I would never halt the execution of the program because, for example, the printer or the mouse was not installed or attached to the system.  This would obviously not make for a professional running system.  I would however inform the user that they need to install a printer before trying to print using the program.

In fact even if the user starts the computer in safe mode, the program will not complain.  It will run as best it can.  However if they call me for support and I see that their computer is running in safe mode, then I have an idea as to where to start troubleshooting.

Dave B.
Sunday, October 12, 2003

Good.  You had me worried : )  Unfortunately, I've ran into way too many 'professional' systems that do ridiculous checks like that before allowing the program to run. 

Depending on the needs of the application, it can be useful to check that the user has appropriate permissions to complete certain actions.  For example, if an install needs write access to HKEY_LOCAL_MACHINE or needs to update a DLL in System32, it probably has to run under an administrator account.  I've found that a simple little check can make support much easier when you get a user who has no clue what you're talking about when you ask if they're logged in as administrator.

SomeBody
Monday, October 13, 2003

If you care for support reasons then just give them a way of running the existing MS Support Report thingie.

Actively checking anything in the above list is pointless.  If you have enough disk space, memory, whatever when you start how often do you check when you're running?

Oh you don't, you handle when you run out of resources...

Well just do that then.

Simon Lucy
Monday, October 13, 2003

>>  "If you care for support reasons then just give them a way of running the existing MS Support Report thingie."

This is something I have tried.  Some users can run msinfo.exe and some can't.  Some know how to email me the info and some don't.  IMO it's simply easier to do a check for yourself than it is to have your program try and run another program that may or may not exist in its proper location or for that matter to walk the user through trying to do it is wasting time.

>> "Actively checking anything in the above list is pointless.  If you have enough disk space, memory, whatever when you start how often do you check when you're running?

Oh you don't, you handle when you run out of resources...

Well just do that then."

First I would like to say that I only check hard drive space  or what have you at critical points in my program and I never let the user see the VB produced error message unless of course the error was unanticipated.

For example, my program writes out MB's of temporary files for print preview.  So before doing so, I check the hard drive space to ensure there is enough room to write the files.  Now I could wait for the user to recieve the "Out of Disk Space" Visual Basic error message, but I choose to inform the user before hand so they know what is going on.  They now have a choice.  Take a chance and continue with the preview or free up some hard disk space.  Also, now when they call me and ask why they can't view all pages of their report they might at least mention my dialog which informs them of low hard drive space therefore I can direct them to clean up the drive. Or they may be more likely to take it upon themselves to do it.

You may be saying to yourself, well you could still wait to you run out of resources and the user would simply tell you the VB error message.  You would be correct, but I choose not to.

My experience has lead me to the conclusion that explicitly checking something for yourself guarantees that you will know it's state.  Leaving this to the user almost always guarantees you a headache and a lot of wasted time.

Viewing these "checks" as something to be avoided is understandable because of people like "Somebody" who have had bad experiences with poorly thought out software.  I have had the same experiences.  On the other hand performing the checks in their proper place and knowing for a fact what the user has on their system without even asking them to do something they may be uncomfortable with is a huge savings in time.

Dave B.
Monday, October 13, 2003

*  Recent Topics

*  Fog Creek Home