* bug#6115: 64 bit windows environment variables
@ 2010-05-05 19:29 RICHARD M. HEIBERGER
2010-05-06 10:23 ` Juanma Barranquero
2010-05-06 13:16 ` Stefan Monnier
0 siblings, 2 replies; 4+ messages in thread
From: RICHARD M. HEIBERGER @ 2010-05-05 19:29 UTC (permalink / raw)
To: 6115; +Cc: ess-core
[-- Attachment #1: Type: text/plain, Size: 735 bytes --]
From the MS Windows 64 bit CMD window I get
c:\>echo %ProgramFiles(x86)%
C:\Program Files (x86)
c:\>echo %ProgramFiles%
C:\Program Files
c:\>echo %ProgramW6432%
C:\Program Files
From
GNU Emacs 23.1.97.1 (i386-mingw-nt6.1.7600) of 2010-05-04 on G41R2F1
I get
(getenv "ProgramFiles(x86)")
"C:\\Program Files (x86)"
(getenv "ProgramFiles")
"C:\\Program Files (x86)"
(getenv "ProgramW6432")
"C:\\Program Files"
In emacs, both the "ProgramFiles*" environment variables give the same
result.
I don't think that should be correct behavior.
Fortunately, Windows provides the ProgramW6432 environment variable.
What is the correct way in emacs to detect the two different locations in
which
Windows puts 32 bit and 64 bit programs?
Rich
[-- Attachment #2: Type: text/html, Size: 1152 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#6115: 64 bit windows environment variables
2010-05-05 19:29 bug#6115: 64 bit windows environment variables RICHARD M. HEIBERGER
@ 2010-05-06 10:23 ` Juanma Barranquero
2010-05-06 13:16 ` Stefan Monnier
1 sibling, 0 replies; 4+ messages in thread
From: Juanma Barranquero @ 2010-05-06 10:23 UTC (permalink / raw)
To: RICHARD M. HEIBERGER; +Cc: 6115, ess-core
On Wed, May 5, 2010 at 21:29, RICHARD M. HEIBERGER <rmh@temple.edu> wrote:
> c:\>echo %ProgramFiles%
> C:\Program Files
> (getenv "ProgramFiles")
> "C:\\Program Files (x86)"
The variable ProgramFiles points to the right application directory
for the current application. On a 64-bit Windows, for a 64-bit app
(like cmd.exe), that's "C:\Program Files"; for a 32-bit app (like
Emacs), that's "C:\Program Files (x86)".
So nothing wrong here.
Juanma
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#6115: 64 bit windows environment variables
2010-05-05 19:29 bug#6115: 64 bit windows environment variables RICHARD M. HEIBERGER
2010-05-06 10:23 ` Juanma Barranquero
@ 2010-05-06 13:16 ` Stefan Monnier
2010-05-10 11:43 ` Martin Maechler
1 sibling, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2010-05-06 13:16 UTC (permalink / raw)
To: RICHARD M. HEIBERGER; +Cc: 6115, ess-core
>> From the MS Windows 64 bit CMD window I get
> c:\>echo %ProgramFiles(x86)%
> C:\Program Files (x86)
> c:\>echo %ProgramFiles%
> C:\Program Files
[...]
> GNU Emacs 23.1.97.1 (i386-mingw-nt6.1.7600) of 2010-05-04 on G41R2F1
> I get
> (getenv "ProgramFiles(x86)")
> "C:\\Program Files (x86)"
> (getenv "ProgramFiles")
> "C:\\Program Files (x86)"
[...]
> In Emacs, both the "ProgramFiles*" environment variables give the same
> result. I don't think that should be correct behavior.
I know close to nothing about Windows, but I expect this has nothing to
do with Emacs itself but instead it's a feature of the OS, where
%ProgramFiles% returns "C:\Program Files" when running a 64bit program
and "C:\Program Files (x86)" when running a 32bit program (and
apparently your Emacs was compiled as a 32bit program).
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#6115: 64 bit windows environment variables
2010-05-06 13:16 ` Stefan Monnier
@ 2010-05-10 11:43 ` Martin Maechler
0 siblings, 0 replies; 4+ messages in thread
From: Martin Maechler @ 2010-05-10 11:43 UTC (permalink / raw)
To: Stefan Monnier; +Cc: RICHARD M. HEIBERGER, 6115, ess-core
>>>>> "SM" == Stefan Monnier <monnier@iro.umontreal.ca>
>>>>> on Thu, 06 May 2010 09:16:28 -0400 writes:
>>> From the MS Windows 64 bit CMD window I get
>> c:\>echo %ProgramFiles(x86)%
>> C:\Program Files (x86)
>> c:\>echo %ProgramFiles%
>> C:\Program Files
SM> [...]
>> GNU Emacs 23.1.97.1 (i386-mingw-nt6.1.7600) of 2010-05-04 on G41R2F1
>> I get
>> (getenv "ProgramFiles(x86)")
>> "C:\\Program Files (x86)"
>> (getenv "ProgramFiles")
>> "C:\\Program Files (x86)"
SM> [...]
>> In Emacs, both the "ProgramFiles*" environment variables give the same
>> result. I don't think that should be correct behavior.
SM> I know close to nothing about Windows, but I expect this has nothing to
SM> do with Emacs itself but instead it's a feature of the OS, where
SM> %ProgramFiles% returns "C:\Program Files" when running a 64bit program
SM> and "C:\Program Files (x86)" when running a 32bit program (and
SM> apparently your Emacs was compiled as a 32bit program).
BTW: Also note that this is *VERY MUCH* dependent on the
"locale" where you use Windoze, i.e. typically on the
language chosen there.
IIRC, in German its "C:\Programme", in French "C:\Programmes"
but I'm pretty sure there are important languages where the
string does not even start with "Program".
For this reason, it's very important that good Windoze software
does *NOT* use any such "C:\Progr*" strings, but rather uses the
environment variables instead, as inidicated
by Stefan's example Emacs-lisp code above.
Thank you, Stefan!
Martin Maechler, ETH Zurich
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-05-10 11:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-05 19:29 bug#6115: 64 bit windows environment variables RICHARD M. HEIBERGER
2010-05-06 10:23 ` Juanma Barranquero
2010-05-06 13:16 ` Stefan Monnier
2010-05-10 11:43 ` Martin Maechler
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.