安装程序问题:“程序文件”或“程序文件(x86)”?

时间:2022-07-25 16:02:17

I am installing a .NET (C#) application that is 100% managed code. The installer (InnoSetup) always wants to install the application to the "Program Files (x86)" folder in Vista x64, which I'm assuming is because the installer itself is only 32bit. (please correct me if I am wrong) Here are my questions:

我正在安装一个100%托管代码的.NET(C#)应用程序。安装程序(InnoSetup)总是希望将应用程序安装到Vista x64中的“Program Files(x86)”文件夹中,我假设这是因为安装程序本身只有32位。 (如果我错了请纠正我)以下是我的问题:

  1. Does being in the x86 folder affect my application at all in a behind-the-scenes way that I'm not aware of?
  2. 是否在x86文件夹中以我不知道的幕后方式影响我的应用程序?

  3. I'm assuming that my application will still run as a true x64 application, despite being in the x86 folder - is this correct?
  4. 我假设我的应用程序仍然作为一个真正的x64应用程序运行,尽管在x86文件夹中 - 这是正确的吗?

  5. Would there be any advantage in having the installer put the application in the "Program Files" folder?
  6. 让安装程序将应用程序放在“Program Files”文件夹中会有什么好处吗?

Thanks!

3 个解决方案

#1


  1. Probably not. Being in that (x86) folder makes older applications tend to find it easier (if that's needed) because they reference it by the environment variable.

    可能不是。在(x86)文件夹中,旧应用程序往往更容易找到它(如果需要),因为它们通过环境变量引用它。

  2. Yes. As long as your EXE is marked as "Any CPU" it should be JIT compiled as 64 bit.

    是。只要您的EXE标记为“任何CPU”,它应该被JIT编译为64位。

  3. It'd be clearer that it's 64 bit.

    它更清楚,它是64位。

#2


Reference: Install Mode: 32-bit vs. 64-bit.

参考:安装模式:32位与64位。

  1. Definitely not. You could put your program in C:\Users\All Users\Desktop, and your application would run just fine.

    当然不。您可以将您的程序放在C:\ Users \ All Users \ Desktop中,您的应用程序就可以正常运行。

  2. As Jeff mentions, if you are compiling to "Any CPU" managed code, this code can be run on 32-bit or 64-bit Frameworks. Perhaps it is because the code can run on 32-bit that the installer chooses the 32-bit Program Files directory. I don't know InnoSetup much at all.

    正如Jeff所提到的,如果您正在编译“Any CPU”托管代码,则此代码可以在32位或64位框架上运行。也许是因为代码可以在32位上运行,安装程序会选择32位Program Files目录。我根本不知道InnoSetup。

    Reference: advantages to compiling as 64 bit and considerations of 32 bit vs. 64 bit. Things to think about in choosing "all 64 bit". And also even when you do, asking the question "Are you sure?"...

    参考:编译为64位的优点以及32位与64位的考虑因素。选择“全64位”时要考虑的事情。而且即使你这样做,也会问“你确定吗?”......

  3. I would not recommend putting 32-bit programs in the 64-bit installation directory, but this is simply for convention. You should be able to configure a default installation path in the installer script.

    我不建议在32位安装目录中放置32位程序,但这只是为了惯例。您应该能够在安装程序脚本中配置默认​​安装路径。

#3


The only problem i could think if you hardcoded any values for manipulating files in that folder. But im sure you didnt :)

如果你硬编码任何值来操纵该文件夹中的文件,我唯一能想到的问题。但我相信你没有:)

#1


  1. Probably not. Being in that (x86) folder makes older applications tend to find it easier (if that's needed) because they reference it by the environment variable.

    可能不是。在(x86)文件夹中,旧应用程序往往更容易找到它(如果需要),因为它们通过环境变量引用它。

  2. Yes. As long as your EXE is marked as "Any CPU" it should be JIT compiled as 64 bit.

    是。只要您的EXE标记为“任何CPU”,它应该被JIT编译为64位。

  3. It'd be clearer that it's 64 bit.

    它更清楚,它是64位。

#2


Reference: Install Mode: 32-bit vs. 64-bit.

参考:安装模式:32位与64位。

  1. Definitely not. You could put your program in C:\Users\All Users\Desktop, and your application would run just fine.

    当然不。您可以将您的程序放在C:\ Users \ All Users \ Desktop中,您的应用程序就可以正常运行。

  2. As Jeff mentions, if you are compiling to "Any CPU" managed code, this code can be run on 32-bit or 64-bit Frameworks. Perhaps it is because the code can run on 32-bit that the installer chooses the 32-bit Program Files directory. I don't know InnoSetup much at all.

    正如Jeff所提到的,如果您正在编译“Any CPU”托管代码,则此代码可以在32位或64位框架上运行。也许是因为代码可以在32位上运行,安装程序会选择32位Program Files目录。我根本不知道InnoSetup。

    Reference: advantages to compiling as 64 bit and considerations of 32 bit vs. 64 bit. Things to think about in choosing "all 64 bit". And also even when you do, asking the question "Are you sure?"...

    参考:编译为64位的优点以及32位与64位的考虑因素。选择“全64位”时要考虑的事情。而且即使你这样做,也会问“你确定吗?”......

  3. I would not recommend putting 32-bit programs in the 64-bit installation directory, but this is simply for convention. You should be able to configure a default installation path in the installer script.

    我不建议在32位安装目录中放置32位程序,但这只是为了惯例。您应该能够在安装程序脚本中配置默认​​安装路径。

#3


The only problem i could think if you hardcoded any values for manipulating files in that folder. But im sure you didnt :)

如果你硬编码任何值来操纵该文件夹中的文件,我唯一能想到的问题。但我相信你没有:)