.net InstallUtil utility – 32 bit vs 64 bit

64-bitinstallutilnet

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?

Best Answer

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).