.net InstallUtil 实用程序 - 32 位与 64 位

发布于 2024-08-09 00:47:07 字数 379 浏览 2 评论 0原文

我有一个编译为 AnyCPU 的 Windows 服务。我正在尝试将其放入我们的安装程序中进行分发。但是...我不清楚 InstallUtil 的 32 位和 64 位版本之间的区别。有谁知道有什么(如果有的话)?

在我的 64 位计算机上,我可以运行 $(WinDir)\Microsoft.NET\Framework64\v2.0.50727 或 $(WinDir)\Microsoft.NET\Framework\v2.0.50727。

在这两种情况下,任务管理器中生成的服务进程都不会应用 *32 标志。

只有 32 位 InstallUtil 可以在 32 位机器上运行(显然)。

是否需要使用\Framework64\版本的InstallUtil?它有什么不同的作用?

I've got a windows service compiled as AnyCPU. I'm trying to get it into our installer to distribute. However... I am unclear on the difference between the 32 bit and 64 bit versions of InstallUtil. Does anyone know what (if any) there are?

On my 64 bit machine, I can run either the $(WinDir)\Microsoft.NET\Framework64\v2.0.50727 or the $(WinDir)\Microsoft.NET\Framework\v2.0.50727.

In both cases, the resulting service Process in Task Manager does not have the *32 flag applied to it.

Only the 32 bit InstallUtil works on 32 bit machines (obviously).

Is there a need to use the \Framework64\ version of InstallUtil? What does it do differently?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

苦行僧 2024-08-16 00:47:07

根据this,您应该使用64位版本来安装64 位和 MSIL 程序集,但没有说明原因。

从 .NET Framework 2.0 版开始,32 位版本
公共语言运行时 (CLR) 仅附带 32 位版本
安装程序工具,但 64 位版本的 CLR 附带
安装程序工具的 32 位和 64 位版本。当使用
64位CLR,使用32位Installer工具安装32位
程序集和 64 位安装程序工具来安装 64 位和
Microsoft 中间语言 (MSIL) 程序集。两个版本
安装程序工具的行为相同。

我相信这里解释了原因。如果您查看帖子的底部,它会解释两者之间的一些差异以及何时使用 32 位 intallutil。

Installutil.exe 是为特定平台构建的,因此它将
作为 32 或 64 位进程启动,相关的注册表配置单元将是
已更新。请注意,如果您有平台内置的管理单元
切换,您将只能在其中一个配置单元中注册它
(32 位或 64 位)。

According to this, you are supposed to use the 64 bit version to install 64-bit and MSIL assemblies, but it doesn't say why.

Starting with the .NET Framework version 2.0, the 32-bit version of
the common language runtime (CLR) ships with only the 32-bit version
of the Installer tool, but the 64-bit version of the CLR ships with
both 32-bit and 64-bit versions of the Installer tool. When using the
64-bit CLR, use the 32-bit Installer tool to install 32-bit
assemblies, and the 64-bit Installer tool to install 64-bit and
Microsoft intermediate language (MSIL) assemblies. Both versions of
the Installer tool behave the same.

I believe here explains why. If you look at the bottom of the post, it explains some differences between the two and when to use the 32-bit intallutil.

Installutil.exe is built for a specific platform, therefore it will
start as a 32 or 64-bit process and the related registry hive will be
updated. Note that if you have a snap-in built with the platform
switch, you will only be able to register it in one of the hives
(32-bit or 64-bit).

青巷忧颜 2024-08-16 00:47:07

我也遇到过这个。问题是我的 VS2008 项目设置为平台目标:任何 CPU。无论我在 64 位操作系统上运行哪个 InstallUtil.exe(32 或 64),它都会安装为 64 位。

我将项目设置 Target 更改为 x86,然后运行 ​​32 位 installutil.exe,一切正常。现在,它在任务管理器中显示 *32 标志。

I ran across this as well. The issue was my VS2008 project was set to Platform Target: Any CPU. No matter which InstallUtil.exe (32 or 64) I ran on the 64 bit OS it was installing as 64 bit.

I changed my project setting Target to x86 and then ran the 32 bit installutil.exe and everything works fine. It now shows the *32 flag in Task Manager.

心凉 2024-08-16 00:47:07

如果您仅安装 64 位程序集,则 32 位 InstallUtil 将无法加载它。您需要使用 64 位版本。

If you're installing a 64-bit only assembly, the 32-bit InstallUtil won't be able to load it. You'll need to use the 64-bit version.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文