I spent quite a few hours yesterday dealing with an intriguing thing that hapenned two days ago while I installed Windows Vista in Spanish on a new computer. To my surprise, every setup that I tried suggested “C:\Program Files” (in English) as the default destination, instead of “C:\Archivos de programa” which is the localized Spanish name. I changed a few things, delete some folders and in the end I had to reformat the hard disk. So, after reformatting I verified that setups insisted on suggesting “C:\Program Files” as destination folder instead of the Spanish localization. How come? I investigated and here are my conclusions:
- Previous to Windows Vista, there were English versions of Windows and localized versions of Windows. For the localized versions the folder names are localized. Windows XP also allowed Multiple User Interface (MUI) where you install a language pack over an English version and you have the user interface localized. This is similar, but not the same (regarding folder names), than a localized Windows version.
- Windows Vista eliminates localized versions and instead uses MUI for all languages (even English). There is a language-neutral base and language packs. A consequence of this is that folder names are no longer localized. So, the folder for programs is always C:\Program Files, even is the language pack is Spanish.
- Until Windows XP, when you call the Shell API functions SHGetSpecialFolderPath, SHGetFolderPath or the System.Environment.GetFolderPath of the .NET Framework it returns the localized folder name. On Windows Vista, it returns the English name (the one actually on disk). For this reason older setups now suggest C:\Program Files always, instead of a localized name. This will confuse the user, of course.
- To complicate things, despite that the actual names of the folders on disk are always on English, the shell of Windows shows them in a localized way. For example, using the Windows explorer the folder “C:\Program Files” is displayed as “C:\Archivos de programa” and “C:\Users” is displayed as “C:\Usuarios”.
- To complicate things even further, there are two hidden “junction points” in the root folder of C:. A junction point is just a link to a folder. One of junctions points is from “C:\Documents and Settings” to “C:\Users” and I guess this is because that location has changed, and there could be legacy setups that used the hardcoded the path “C:\Documents and Settings” instead of calling the Shell API. The other junction point is from “C:\Archivos de programa” to “C:\Program Files” and it is more intriguing because no setup would hardcode a non English folder name. So, which is the purpose of this joint point? I suppose that it only makes sense if you are upgrading from Windows XP to Windows Vista (rather than a clean installation).
- There is a new shell API function in Windows Vista, SHGetLocalizedName, that returns the localized name of a folder, as the Windows Explorer shows it to the user. I hope that new installers and setups become aware of Windows Vista an use this API function to suggest a destination folder like “C:\Archivos de programa” instead of “C:\Program Files” in the textbox for the location of the application. Once the installer gets a localized destination folder, the junction point from “C:\Archivos de programa” to “C:\Program Files” should make it install in the correct location.
Why all these changes? Apart from the new unified MUI approach that dictates non-localized names on disk (only localized when displayed to the user) and that there is a stupid 260 character limit in paths that MS would like to fix and that makes long folders names like “C:\Documents and Settings” not very friendly, it seems that MS preferred safety on folder locations even it that means confusing the user and for that reason they changed the behavior of the Shell functions. So, the implementation model wins over the user mental model. Now we can only hope that new setups aware of this Vista problem fill the gap to show to the user only localized names like the Windows Explorer does, not actual names on disk.
4 thoughts on “Windows Vista junctions points, MUI and localized folder names”
I just saw the same thing. When opening my Vista c-drive remotely from an XP computer (vistamachine\c$), I found both the localized and the english folder names. Only the english ones were accessible.
Saludos Carlos, tengo una duda sobre este tema (justo andaba buscando en la red y encontré tu blog), conoces forma de quitar esta localización? (me refiero a no ver “Archivos de programa”, sino el real “Program files”).
Me ahorrarías “investigación” si me dices que lo intentaste.
Gracias de antemano, saludos
I am having real problems with the old version of this system. I have many VBA scripts written on a machine with English XP installed and I’ve just set up a Portuguese XP machine. Most of my data files are in a folder that I added to the Models (Modelos in PT) directory and which I access in code like this, TXTpath = (Options.DefaultFilePath(2) & “TXT”).
However I have a couple of very basic scripts that use the shell command to open these text files in Wordpad. The problem is that Wordpad is in %ProgramFiles%WindowsNT/Accessories/ but in the PT version that has changed to %ProgramFiles%WindowsNT/Accesórios on the hard drive itself – that’s the real folder name.
I have not been able to find any way of getting a handle on that without simply hardcoding the folder name – a terrible sin in my opinion!
So I end up with this:
FilePath = TXTpath & “List.txt”
CMDLine = “C:\Program Files\Windows NT\Accessórios\WORDPAD.EXE ” & FilePath
RetVal = Shell(CMDLine, 1)
which is horrible. Any suggestions?
Hi Carlos, I just came across this blog by chance and it reminded me that I read a blog by Michael Kaplan about the same subject.
It’s quite old now, but may still be interesting.
Comments are closed.