----- Original Message -----
From: <
[email protected]>
Newsgroups: comp.lang.perl.misc
Sent: Friday, April 27, 2007 2:56 AM
Subject: Determining difference from Vista32 and Vista64
Is ther any way to determine in the running code the type of OS and
distinguish from 32-bit vs 64-bit Vista or XP. I know the
Win32::GetOSVersion call but both the 32-bit and 64-bit of Vista
return the same thing for $major, $minor and $id.
Ok - so you've worked out how to determine whether it's Vista or not.
(Actually, I'd probably use Win32::GetOSName instead.)
If it's a 64 bit operating system (both XP and Vista, I think) there'll be a
C:\Windows\SysWOW64\ folder - otherwise that folder won't exist.
Actually, faik, there may be a way of installing Windows in such a way that
the system files don't go into the C drive at all .... which would
complicate matters a little.
Anyway, on my Vista64 box:
C:\_32>perl -MWin32 -e "print Win32::GetOSName"
WinVista
C:\_32>perl -e "print -e 'C:/Windows/SysWOW64/cmd.exe'"
1
And that's the same irrespective of whether it's run in the
C:\Windows\System32\cmd.exe shell or the C:/Windows/SysWOW64/cmd.exe shell
.... and irrespective of whether I run ActiveState's 32-bit build of perl or
their 64-bit build.
Cheers,
Rob