Archive: PROGRAMFILES Windows 7


PROGRAMFILES Windows 7
Hi all,

I got a problem with the PROGRAMFILES folder on Windows 7 (german version).

Windows 7 detects the variable $PROGRAMFILES as

"C:\Program Files"

But in Windows 7 only exists "C:\Programme" therefore the files will be installed in "C:\Programme" and not in "C:\Program Files".

I write the path into the registry so that an external software can read the path from the entry to start it.
But because NSIS detects "Program Files" instead of the real folder "Programme" the software can't be executed. The shortcuts point to "C:\Program Files" which doesn't exist.

Is there a way to fix that?

Thanks for help :(


AFAIK, NSIS gets the path from the %ProgramFiles% environment variable. Could your environment variables be corrupt?

To see what current setting is, from a command prompt window, run

ECHO PROGRAMFILES=%PROGRAMFILES%


It it's wrong then something in Windows is broke.

It is important to understand that in Windows 7, if you are looking through Explorer on a non-English OS, Explorer will show you "C:\Programme" EVEN THOUGH the actual file name of the directory is "C:\Program Files" in the file system.

To verify this, you need to use another file system browser (I would recommend Total Commander - http://www.ghisler.com/ ) and look at the root of your C: drive. You will find a hidden .ini file in the root of Program Files that will tell Explorer what name it should display instead of the actual file system name. This makes it easier for them to localize the OS without having to localize the file system. I have personally looked at French Windows 7 and I see this.

NSIS (thankfully) will not lie to you and it will show you the factual file system names.


Originally posted by Zinthose
AFAIK, NSIS gets the path from the %ProgramFiles% environment variable.
Wrong, NSIS does not use any environment variables, it only uses documented API functions like SHGet*(). The windows api to retrieve the temp dir does use %temp% internally, so that is the only one that could have a problem

Anders, It dose make more sense to me to use API Calls but I got the notion from somewhere.

I dug around in the documentation and found 3.1.3. It is clearly only used to the build environment and not the installer. But likely were I got the erroneous idea... :(

My Bad.


Yes, the compiler has a couple, but that is because they SHOULD be possible to edit (and some of them are non standard with no shell constant)


Thanks for your answers!

@Crashbug: You are right, its easier for Microsoft, but not for me, because the program cant read the correct path ;) But thanks for the hint with total commander and the ini file!

Well, its not that bad, I will try to avoid the use of $PROGRAMFILES for this application.

Have a nice day!


It's "CrushBug" =)

The program is reading the correct path. It is not wrong. What I am trying to say is that Explorer is lying to you and not NSIS and not the file system. It also sounds like that other program is not handling the file system properly.

I will double check one of our installers on French and see what happens because I know our stuff works.


/* off topic */
Remove Win 7


I tested windows 7 and the paths displayed on nsis directory page are wrong, maybe some unfinished job, I don't know...I still use XP for testing apps.


CrushBug is right. The internal Windows 7 name is 'C:\Program Files', the Explorer shows 'C:\Programme' on your German system, though.

If you install your application in the detected 'C:\Program Files' folder, it will be correctly installed in the your 'C:\Programme' folder.

Just ignore what you see, the path will be correctly detected and after installation, you will see, that all things went well. ;)

Joel:

I'm not seeing any Windows 7 related path issues. All of my installers work well. For the above 'issue' you simply can ignore it, the files will be installed in the correct path, even if you'd guess, that the file path is wrong.