Sunday, January 20, 2008

%PROGRAMFILES% - WTF?

Thesis: C:\Program Files was OK, but now it's horrible, and Microsoft is the reason.

So, in the old days there was C:\Program Files. That's totally OK -- it's good to have some centralized place to install programs to. But then Microsoft screwed it up. Someone noticed that Program Files isn't a localized name -- if you're German, or Mongolian, or anything but an English-speaker, it might as well be named C:\Giberish Stuff.

So there are two solutions. One is to change the name of the directory. The other is to change not what the actual place is but just how it's viewed in the Explorer. In typical Microsoft fashion, they did both. So I don't get the simplicity of a constant location, and I don't know what the user will see in Explorer.

3 comments:

Anonymous said...

User will see what they opted to see when they installed (localized) Windows.

As for you as a developer, how about using SHGetSpecialFolderLocation() instead of hard-coding paths or using environment variable expansion?

http://msdn2.microsoft.com/en-us/library/bb762203(VS.85).aspx

Hint : CSIDL_PROGRAM_FILES or CSIDL_PROGRAM_FILESX86

Anonymous said...

Or even better if you just need a path use SHGetFolderPath():

http://msdn2.microsoft.com/en-us/library/bb762181(VS.85).aspx

Sunrise Programmer said...

I wasn't making myself clear enough. I agree that non-Enlish users shouldn't see the words "Program Files". The problem is that there are two ways of doing that -- one is to change the name of the directory, and the other is to change the name that the user sees in Explorer.

Each solution has good points and bad points. Doing both, though, is much worse -- the actual directory can be called pretty much anything, and what the user sees can be pretty much anything. Together, that's a whole lot of possibilities.

And yes, in my own programs I'm careful to use the correct MS library to get these locations.

Note: if you do localization testing with, e.g., Vista, it turns out that "installing Vista and setting the language to non-english" and "installing Vista as non-english" are different. They look similar, but work (slightly) differently.

Where I work this irritated the QA department -- they were hoping to just to english installs and change the language (which fits in nicely with how they set up the QA lab), but instead they had to set up one machine as one language, and another as a different language, and so on. It was much more work for them, and so far hasn't uncovered any extra bugs.