GNU bug report logs - #6115
64 bit windows environment variables

Previous Next

Package: emacs;

Reported by: "RICHARD M. HEIBERGER" <rmh <at> temple.edu>

Date: Wed, 5 May 2010 19:42:02 UTC

Severity: normal

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 6115 in the body.
You can then email your comments to 6115 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6115; Package emacs. (Wed, 05 May 2010 19:42:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to "RICHARD M. HEIBERGER" <rmh <at> temple.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 05 May 2010 19:42:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "RICHARD M. HEIBERGER" <rmh <at> temple.edu>
To: emacs-pretest-bug <at> gnu.org
Cc: ess-core <at> stat.math.ethz.ch
Subject: 64 bit windows environment variables
Date: Wed, 5 May 2010 15:29:54 -0400
[Message part 1 (text/plain, inline)]
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
[Message part 2 (text/html, inline)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6115; Package emacs. (Thu, 06 May 2010 10:25:02 GMT) Full text and rfc822 format available.

Message #8 received at 6115 <at> debbugs.gnu.org (full text, mbox):

From: Juanma Barranquero <lekktu <at> gmail.com>
To: "RICHARD M. HEIBERGER" <rmh <at> temple.edu>
Cc: 6115 <at> debbugs.gnu.org, ess-core <at> stat.math.ethz.ch
Subject: Re: bug#6115: 64 bit windows environment variables
Date: Thu, 6 May 2010 12:23:38 +0200
On Wed, May 5, 2010 at 21:29, RICHARD M. HEIBERGER <rmh <at> 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




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6115; Package emacs. (Thu, 06 May 2010 13:17:01 GMT) Full text and rfc822 format available.

Message #11 received at 6115 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "RICHARD M. HEIBERGER" <rmh <at> temple.edu>
Cc: 6115 <at> debbugs.gnu.org, ess-core <at> stat.math.ethz.ch
Subject: Re: bug#6115: 64 bit windows environment variables
Date: Thu, 06 May 2010 09:16:28 -0400
>> 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




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#6115; Package emacs. (Mon, 10 May 2010 11:50:02 GMT) Full text and rfc822 format available.

Message #14 received at 6115 <at> debbugs.gnu.org (full text, mbox):

From: Martin Maechler <maechler <at> stat.math.ethz.ch>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: "RICHARD M. HEIBERGER" <rmh <at> temple.edu>, 6115 <at> debbugs.gnu.org,
	ess-core <at> stat.math.ethz.ch
Subject: Re: bug#6115: 64 bit windows environment variables
Date: Mon, 10 May 2010 13:43:22 +0200
>>>>> "SM" == Stefan Monnier <monnier <at> 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




bug closed, send any further explanations to "RICHARD M. HEIBERGER" <rmh <at> temple.edu> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 21 May 2010 07:08:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 18 Jun 2010 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 15 years and 62 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.