如何确定我安装的应用程序是32位还是64位?

时间:2022-09-01 11:14:39

I want to be able to predict the default install location of an application. On a 64 bit machine, if it is a 32bit application, it would install in "Program Files (x86)" and if it were a 64bit application, it would install in "Program Files".

我希望能够预测应用程序的默认安装位置。在64位计算机上,如果它是32位应用程序,它将安装在“Program Files(x86)”中,如果它是64位应用程序,它将安装在“Program Files”中。

My goal is to install the application with its default location and validate if the install was fine. But for this I need to know where it would be installed. If I know what architecture the application is built for, I think it would serve my purpose.

我的目标是使用其默认位置安装应用程序并验证安装是否正常。但为此,我需要知道它的安装位置。如果我知道构建应用程序的架构,我认为它符合我的目的。

2 个解决方案

#1


1  

Download file for Windows to check the details of any file on Windows:

下载Windows文件以检查Windows上任何文件的详细信息:

http://gnuwin32.sourceforge.net/packages/file.htm

http://gnuwin32.sourceforge.net/packages/file.htm

Then, via the Windows command line:

然后,通过Windows命令行:

C:\> "C:\Program Files\GnuWin32\bin\file" name-of-file.exe
name-of-file.exe executable for MS Windows (GUI) Intel 80386 32-bit

You should be able to grab the return value of this command from whatever development platform your working with.

您应该能够从您使用的任何开发平台获取此命令的返回值。

#2


0  

No need to determine. 32-bit apps on windows 64-bit runs on WoW64, which does redirection automatically. If the installer was 32-bit then %ProgramFiles% would be C:\Program Files (x86) so by default 32-bit application will always be installed to the correct location

无需确定。 Windows 64位上的32位应用程序在WoW64上运行,它自动进行重定向。如果安装程序是32位,则%ProgramFiles%将是C:\ Program Files(x86),因此默认情况下32位应用程序将始终安装到正确的位置

#1


1  

Download file for Windows to check the details of any file on Windows:

下载Windows文件以检查Windows上任何文件的详细信息:

http://gnuwin32.sourceforge.net/packages/file.htm

http://gnuwin32.sourceforge.net/packages/file.htm

Then, via the Windows command line:

然后,通过Windows命令行:

C:\> "C:\Program Files\GnuWin32\bin\file" name-of-file.exe
name-of-file.exe executable for MS Windows (GUI) Intel 80386 32-bit

You should be able to grab the return value of this command from whatever development platform your working with.

您应该能够从您使用的任何开发平台获取此命令的返回值。

#2


0  

No need to determine. 32-bit apps on windows 64-bit runs on WoW64, which does redirection automatically. If the installer was 32-bit then %ProgramFiles% would be C:\Program Files (x86) so by default 32-bit application will always be installed to the correct location

无需确定。 Windows 64位上的32位应用程序在WoW64上运行,它自动进行重定向。如果安装程序是32位,则%ProgramFiles%将是C:\ Program Files(x86),因此默认情况下32位应用程序将始终安装到正确的位置