From unknown Sat Aug 16 11:38:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6115: 64 bit windows environment variables Resent-From: "RICHARD M. HEIBERGER" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 May 2010 19:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 6115 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 6115@debbugs.gnu.org Cc: ess-core@stat.math.ethz.ch X-Debbugs-Original-To: emacs-pretest-bug@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.127308847829594 (code B ref -1); Wed, 05 May 2010 19:42:02 +0000 Received: (at submit) by debbugs.gnu.org; 5 May 2010 19:41:18 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9kT7-0007hE-CO for submit@debbugs.gnu.org; Wed, 05 May 2010 15:41:17 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9kPO-0007f0-0T for submit@debbugs.gnu.org; Wed, 05 May 2010 15:37:26 -0400 Received: from mx10.gnu.org ([199.232.76.166]:57217) by fencepost.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9kPJ-0006O7-Re for emacs-pretest-bug@gnu.org; Wed, 05 May 2010 15:37:21 -0400 Received: from eggs.gnu.org ([140.186.70.92]:37274) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1O9kPJ-0001a0-Bg for emacs-pretest-bug@gnu.org; Wed, 05 May 2010 15:37:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O9kI8-0005a6-4H for emacs-pretest-bug@gnu.org; Wed, 05 May 2010 15:30:01 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from mail-iw0-f189.google.com ([209.85.223.189]:56215) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9kI8-0005Zk-0i for emacs-pretest-bug@gnu.org; Wed, 05 May 2010 15:29:56 -0400 Received: by iwn27 with SMTP id 27so6742844iwn.5 for ; Wed, 05 May 2010 12:29:54 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.190.204 with SMTP id dj12mr1266100ibb.9.1273087794354; Wed, 05 May 2010 12:29:54 -0700 (PDT) Received: by 10.231.30.139 with HTTP; Wed, 5 May 2010 12:29:54 -0700 (PDT) Date: Wed, 5 May 2010 15:29:54 -0400 Message-ID: From: "RICHARD M. HEIBERGER" Content-Type: multipart/alternative; boundary=0016363b888cc01b800485ddd969 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-Spam-Score: -6.6 (------) X-Mailman-Approved-At: Wed, 05 May 2010 15:41:15 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.6 (------) --0016363b888cc01b800485ddd969 Content-Type: text/plain; charset=ISO-8859-1 >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 --0016363b888cc01b800485ddd969 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
From the MS Windows 64 bit CMD window I get
=A0
c:\>echo %ProgramFiles(x86)%
C:\Program Files (x86)
=A0
c:\>echo %ProgramFiles%
C:\Program Files

c:\>echo %ProgramW6432%
C:\Program Files
=A0
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)&quo= t;
(getenv "ProgramW6432")
"C:\\Program Files"
=
In emacs, both the "ProgramFiles*" environment variables giv= e the same result.
I don't think that should be correct behavior.
=A0
Fortunately, Windows provides the ProgramW6432 environment variable.
=A0
What is the correct way in emacs to detect the two different locations= in which
Windows puts 32 bit and 64 bit programs?
=A0
Rich
=A0
--0016363b888cc01b800485ddd969-- From unknown Sat Aug 16 11:38:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6115: 64 bit windows environment variables Resent-From: Juanma Barranquero Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 May 2010 10:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6115 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "RICHARD M. HEIBERGER" Cc: 6115@debbugs.gnu.org, ess-core@stat.math.ethz.ch Received: via spool by 6115-submit@debbugs.gnu.org id=B6115.12731414442155 (code B ref 6115); Thu, 06 May 2010 10:25:02 +0000 Received: (at 6115) by debbugs.gnu.org; 6 May 2010 10:24:04 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9yFQ-0000Yi-4B for submit@debbugs.gnu.org; Thu, 06 May 2010 06:24:04 -0400 Received: from mail-bw0-f214.google.com ([209.85.218.214]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O9yFN-0000YM-LB for 6115@debbugs.gnu.org; Thu, 06 May 2010 06:24:02 -0400 Received: by bwz6 with SMTP id 6so3271932bwz.39 for <6115@debbugs.gnu.org>; Thu, 06 May 2010 03:23:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=h82TVBEeCyP0G2ADX2x15AYTyM/qKqWkMu84dsprsQ8=; b=opWl6y7iv0INWhVH76p/Dmnni/Ha7Z9IBBVyN9qHU+kcTLHRQCJXzHX0qe4t3fcj+9 0EinNQXrX4zeDJu9e/Yogw9k8Kzv0OXOf/MLLWZ63FT6mLcPla7+zBhiA4uDjHnZz/tT wu4FAZsQOCc91U+MFkegRcqN52CS+XHI225q4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=vad8wzawMO4rJX45uzgH2zwMinKW1KPP/Zky0BaQGhp+kd3KkAlQuOd7aHtTCYLisR EwbP88YiKtIRDs0n3QJho7bSJT6fBlppx+FoVadA4UsPSw3SYAXJicXEV8MMjqT/UZzD gblajCJ+PH3fL6gMFH+qgjmTkoCrFOtXcqFHM= Received: by 10.204.141.214 with SMTP id n22mr3575492bku.18.1273141438132; Thu, 06 May 2010 03:23:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.84.81 with HTTP; Thu, 6 May 2010 03:23:38 -0700 (PDT) In-Reply-To: References: From: Juanma Barranquero Date: Thu, 6 May 2010 12:23:38 +0200 Message-ID: Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -2.8 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.8 (--) On Wed, May 5, 2010 at 21:29, RICHARD M. HEIBERGER 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 From unknown Sat Aug 16 11:38:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6115: 64 bit windows environment variables Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 06 May 2010 13:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6115 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: "RICHARD M. HEIBERGER" Cc: 6115@debbugs.gnu.org, ess-core@stat.math.ethz.ch Received: via spool by 6115-submit@debbugs.gnu.org id=B6115.12731517969349 (code B ref 6115); Thu, 06 May 2010 13:17:01 +0000 Received: (at 6115) by debbugs.gnu.org; 6 May 2010 13:16:36 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OA0wN-0002Qk-MB for submit@debbugs.gnu.org; Thu, 06 May 2010 09:16:35 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.183] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OA0wL-0002Qc-HW for 6115@debbugs.gnu.org; Thu, 06 May 2010 09:16:34 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAGde4kvO+IB1/2dsb2JhbACdZ3K9NIUTBIwwgxI X-IronPort-AV: E=Sophos;i="4.52,341,1270440000"; d="scan'208";a="63568199" Received: from 206-248-128-117.dsl.teksavvy.com (HELO alfajor.home) ([206.248.128.117]) by ironport2-out.pppoe.ca with ESMTP; 06 May 2010 09:16:28 -0400 Received: by alfajor.home (Postfix, from userid 20848) id 099B9AF455; Thu, 6 May 2010 09:16:28 -0400 (EDT) From: Stefan Monnier Message-ID: References: Date: Thu, 06 May 2010 09:16:28 -0400 In-Reply-To: (RICHARD M. HEIBERGER's message of "Wed, 5 May 2010 15:29:54 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -2.1 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.1 (--) >> 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 From unknown Sat Aug 16 11:38:30 2025 X-Loop: help-debbugs@gnu.org Subject: bug#6115: 64 bit windows environment variables Resent-From: Martin Maechler Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 May 2010 11:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 6115 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Monnier Cc: "RICHARD M. HEIBERGER" , 6115@debbugs.gnu.org, ess-core@stat.math.ethz.ch Reply-To: Martin Maechler Received: via spool by 6115-submit@debbugs.gnu.org id=B6115.127349214717367 (code B ref 6115); Mon, 10 May 2010 11:50:02 +0000 Received: (at 6115) by debbugs.gnu.org; 10 May 2010 11:49:07 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBRTu-0004W4-AZ for submit@debbugs.gnu.org; Mon, 10 May 2010 07:49:07 -0400 Received: from hypatia.math.ethz.ch ([129.132.145.15]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OBROg-0004TO-V7 for 6115@debbugs.gnu.org; Mon, 10 May 2010 07:43:43 -0400 Received: from lynne.math.ethz.ch (lynne [129.132.58.30]) by hypatia.math.ethz.ch (8.14.1/8.14.1) with ESMTP id o4ABhN8X023193 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 10 May 2010 13:43:23 +0200 Received: (from maechler@localhost) by lynne.math.ethz.ch (8.14.3/8.13.1/Submit) id o4ABhMRJ009234; Mon, 10 May 2010 13:43:22 +0200 From: Martin Maechler MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19431.61786.110415.368036@lynne.math.ethz.ch> Date: Mon, 10 May 2010 13:43:22 +0200 In-Reply-To: References: X-Mailer: VM 7.19 under Emacs 22.3.1 X-Virus-Scanned: by amavisd-new at stat.math.ethz.ch X-Spam-Score: -4.0 (----) X-Mailman-Approved-At: Mon, 10 May 2010 07:49:04 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.3 (-----) >>>>> "SM" == Stefan Monnier >>>>> 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 From debbugs-submit-bounces@debbugs.gnu.org Fri May 21 03:07:20 2010 Received: (at control) by debbugs.gnu.org; 21 May 2010 07:07:21 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFMKG-0005cW-67 for submit@debbugs.gnu.org; Fri, 21 May 2010 03:07:20 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OFMKE-0005cR-O2 for control@debbugs.gnu.org; Fri, 21 May 2010 03:07:19 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.69) (envelope-from ) id 1OFMKB-0004CF-44; Fri, 21 May 2010 03:07:15 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <19446.12578.798544.901818@fencepost.gnu.org> Date: Fri, 21 May 2010 03:07:14 -0400 From: Glenn Morris To: control Subject: control X-Attribution: GM X-Mailer: VM (www.wonderworks.com/vm), GNU Emacs (www.gnu.org/software/emacs) X-Hue: cyan X-Ran: V:>L),[l2w+1JY0EN)U^T7|l1`^w=ov4r2p(ZUCg(n;o:&tVV2XmYlfQ}U*p'T1cr/1_@g X-Debbugs-No-Ack: yes X-Spam-Score: -5.1 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.1 (-----) close 6115 close 6134 close 6160 close 6031