Detect whether current Windows version is 32 bit or 64 bit

前端 未结 23 2869
抹茶落季
抹茶落季 2020-11-28 03:47

Believe it or not, my installer is so old that it doesn\'t have an option to detect the 64-bit version of Windows.

Is there a Windows DLL call or (even better) an en

23条回答
  •  广开言路
    2020-11-28 04:32

    If you can make API calls, try using GetProcAddress / GetModuleHandle to check for the existence of IsWow64Process which is only present in Windows OS that have 64-bit versions.

    You could also try the ProgramFiles(x86) environment variable used in Vista/2008 for backwards compatibility, but I'm not 100% sure about XP-64 or 2003-64.

    Good luck!

提交回复
热议问题