Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to detect 32-bit Tcl on Windows-x64

711 views
Skip to first unread message

Rolf Schroedter

unread,
Aug 31, 2011, 11:23:45 AM8/31/11
to
Hi all,
I need to avoid that somebody runs my Tcl application with a 32-bit WISH
on a 64-bit Windows system.

I can detect the 32-bit WISH by $tcl_platform(pointerSize).

Any ideas how to detect the underlying 64-bit Windows ?

Regards,
Rolf.

Ashok Nadkarni

unread,
Aug 31, 2011, 1:17:48 PM8/31/11
to

Rolf Schroedter

unread,
Sep 1, 2011, 2:01:31 AM9/1/11
to
Thanks for the link.
So I guess the following test will do it

if { [info exists ::env(ProgramW6432)] } {
...

Rolf Schroedter

unread,
Sep 1, 2011, 5:00:49 AM9/1/11
to
Or, more corresponding to the link:

if { [string match "*64" $::env(PROCESSOR_ARCHITECTURE)] } {
puts "Okay, we are a 64-bit EXE on a 64-bit Windows"
} elseif { [string match "x86" $::env(PROCESSOR_ARCHITECTURE)] } {
if { [info exists env(PROCESSOR_ARCHITEW6432)] } {
error "Cannot run this 32-bit on a 64-bit Windows !"
} else {
puts "Okay, we are a 32-bit EXE on a 32-bit Windows"
}
} else {
error "Unsupported OS/architecture"
}

Rolf.

Zbiggy

unread,
Sep 1, 2011, 8:49:16 PM9/1/11
to
In comp.lang.tcl, Rolf Schroedter wrote:

> error "Cannot run this 32-bit on a 64-bit Windows !"

I didn't check it - but is it true (that one cannot run 32-bit on a 64-bit
Windows)?
--
Z.

Les Cargill

unread,
Sep 1, 2011, 8:57:54 PM9/1/11
to


Answers range from "no" to "it varies". Sorry, no scalar answer - only
vectors :) Almost all the 32 bit stuff I've tried works fine.

For 16 bit, you'll need virtualization.

--
Les Cargill

Rolf Schroedter

unread,
Sep 2, 2011, 2:30:01 AM9/2/11
to

This is true for my application, because it uses a 3rd-party DLL &
device driver available at 64-bit for Win64 and at 32-bit for Win32.
(32-bit device drivers do not run on Win64).

Neil

unread,
Sep 2, 2011, 11:08:32 AM9/2/11
to
It's similar to how WinXP handled 16-bit apps. WOW64 (Windows-On_Windows64) is essentially the same as XP's WOW (Windows-On-Windows(32)).

A basic exe should run (other than drivers, as Rolf notes); but dependencies get complicated. 32-bit apps can't inherently call 64-bit DLLs, for example.

The simpler the EXE, the more chance it has of running.

0 new messages