- NSIS Discussion
- PROGRAMFILES Windows 7
Archive: PROGRAMFILES Windows 7
reace
19th January 2010 14:11 UTC
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 :(
Zinthose
19th January 2010 15:20 UTC
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.
CrushBug
19th January 2010 17:04 UTC
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.
Anders
19th January 2010 18:18 UTC
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
Zinthose
19th January 2010 18:41 UTC
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.
Anders
19th January 2010 18:51 UTC
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)
reace
22nd January 2010 13:24 UTC
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!
CrushBug
23rd January 2010 00:48 UTC
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.
Joel
23rd January 2010 14:55 UTC
/* 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.
Koopa
23rd January 2010 16:16 UTC
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.