确定操作系统位架构而不是处理器架构 [英] Determine OS bit architecture not Processor architecture

查看:56
本文介绍了确定操作系统位架构而不是处理器架构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个小问题,由于无法确定它是否可以在x64位版本上正常运行,因此我的应用程序卡住了.
现在,我正在尝试创建一个VBScript,它将检查OS位并根据OS位安装msi.
通过谷歌搜索此解决方案,我发现了很多垃圾,我认为我不确定是否可以使用.

我发现了另一个有趣的代码,它将检查ProgramFilesx86是否存在,但问题是只有win7拥有此选项来检查xp,并且vista此文件夹似乎不存在.我的处理器是32位的,我无法安装OS x64来自己检查它是否存在什么差异以确保它是什么OS体系结构.
如果有人可以告诉我哪些文件夹或文件或系统文件与32位操作系统不同,我会寻求帮助,以便制作脚本以确保我可以安装哪个msi(我会将两个程序集都嵌入到主程序包中)
某些脚本尝试从注册表中检查,这不适用于所有Win版本.
请向我提供正确的答案,谢谢Begi

I have a little problem and im stuck with my application since im not sure if it will work correctly on a x64 bit version.
Now im trying to create a VBScript which will check for OS bit and install the msi according to the OS bit.
I have found a lot of trash by googling for this solution which i think im not sure if it will work.

I have found another interesting code which will check if ProgramFilesx86 exist but the problem is only win7 has this option to check for xp and vista this folder seems not to exists. My processor is 32bit and i cant install an OS x64 to check it myself what differences are there to ensure what OS architecture it is.
I ask for help if somebody could tell me which folders or files or system files are different to a 32bit OS so to make a script to make sure which msi i can install(i will embed both assemblies on the main package)
Some scripts try to check from registry which will not work to all win versions.
Please refer me to the right answer, thanks Begi

推荐答案

我检查操作系统的位版本的方法是检查是否存在注册表项 HKEY_LOCAL_MACHINE \ SOFTWARE \ WOW6432Node [ ^ ].
如果不存在此密钥,则说明您使用的是32位操作系统,而您使用的是64位操作系统.
The way I check the bit version of the OS is by checking for the presence of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node[^].
If this key is not present you are on a 32-bit OS and 64-bit when it is present.


这篇关于确定操作系统位架构而不是处理器架构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆