.NET Framework Tools


.NET Framework Tools 
Installer Tool (Installutil.exe) 

The Installer tool allows you to install and uninstall server resources by executing the installer components in a specified assembly. This tool works in conjunction with classes in the System.Configuration.Install Namespace.

installutil [/uninstall][option [...]]assemblyname ]
[option [...]]assemblyname 
Remarks

Argument Description

assemblyname

The name of the assembly in which to execute the installer components.

Option Description

/h[elp]

Displays command syntax and options for the tool.

/help assemblypath

Displays any additional options recognized by individual installers within the specified assembly.

/?

Displays command syntax and options for the tool.

/? assemblypath

Displays any additional options recognized by individual installers within the specified assembly.

/LogFile=[filename]

Specifies the name of the log file where install progress is recorded. The default is assemblyname.InstallLog.

/AssemblyName assemblyName

[,Version=major.minor.build.revision]

[,Culture=locale]

[,PublicKeyToken=publicKeyToken]]

Specifies the name of an assembly. The assembly name must be fully qualified with the version, culture, and public key token of the assembly. The fully qualified name must be surrounded by quotes.

For example, "myAssembly, Culture=neutral, PublicKeyToken=0038abc9deabfle5, Version=2.0.0.0" is a fully qualified assembly name.

/LogToConsole={true|false}

If true, displays output to the console. If false (the default), suppresses output to the console.

/ShowCallStack

Prints the call stack to the log if an exception occurs at any point during installation.

/u[ninstall]

Uninstalls an assembly. Unlike other options, /u applies to all assemblies regardless of where it appears on the command line.

Remarks

Starting with the .NET Framework version 2.0, the 32-bit version of the common language runtime (CLR) continues to ship with only the 32-bit version of the Installer tool, but the 64-bit version of the CLR ships with both a 32-bit and a 64-bit version 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 assemblies. Otherwise, both versions of the Installer tool behave the same.

Microsoft .NET Framework applications consist of traditional program files and associated resources, such as message queues, event logs, and performance counters that must be created when the application is deployed. You can use an assembly's installer components to create these resources when your application is installed and to remove them when your application is uninstalled. Installutil.exe detects and executes these installer components.

You can specify multiple assemblies on the same command line. Any option that occurs before an assembly name applies to that assembly's installation. Options specified for one assembly apply to any subsequent assemblies unless the option is specified with a new assembly name.

If you run Installutil.exe against an assembly without specifying any options, it places the following three files into the assembly's directory:

  • InstallUtil.InstallLog

    Contains a general description of the installation progress.

  • assemblyname.InstallLog

    Contains information specific to the commit phase of the installation process. For more information about the commit phase, see the Installer.Commit Method.

  • assemblyname.InstallState

    Contains data used to uninstall the assembly.

Installutil.exe uses reflection to inspect the specified assembly and find all Installer types with the RunInstallerAttribute set to true. The tool then executes either the Install Method or the Uninstall Method on each instance of the Installer type. Installutil.exe performs installation in a transactional manner; if one of the assemblies fails to install, it rolls back the installations of all other assemblies. Uninstall is not transactional.

Installutil.exe can not install or uninstall delay signed assemblies, but can install or uninstall strong named assemblies.

Note that you cannot deploy a Windows service created using C++ with Installutil.exe. Installutil.exe cannot recognize the embedded native code that is produced by the C++ compiler. If you attempt to deploy a C++ Windows service with Installutil.exe, an exception such as BadImageFormatException will be thrown. To work with this scenario, move the service code to a C++ module. Then, write the installer object in C# or Visual Basic.

Examples

The following command displays a description of the command syntax and options.

installutil

The following command executes the installer components in the assembly myAssembly.exe.

installutil myAssembly.exe

The following command executes the installer components in an assembly using the /AssemblyName switch and a fully qualified name.

installutil /AssemblyName "myAssembly, Culture=neutral, PublicKeyToken=0038abc9deabfle5, Version=2.0.0.0"

The following command executes the uninstaller components in the assembly myAssembly.exe.

installutil /u myAssembly.exe 

The following command executes the installers in the assembly myAssembly.exe and specifies that progress information will be written to myLog.InstallLog.

installutil /LogFile=myLog.InstallLog myAssembly.exe 

The following command writes the installation progress for myAssembly.exe to myLog.InstallLog and writes the progress for myTestAssembly.exe to myTestLog.InstallLog.

installutil /LogFile=myLog.InstallLog myAssembly.exe /LogFile = myTestLog.InstallLog myTestAssembly.exe
See Also

Reference

.NET Framework Tools
System.Configuration.Install Namespace
SDK Command Prompt



Community Content

Xipho
Is it allowed to distribute installutil.exe in your setup package?
I am creating a setup package and I need installutil.exe to install some assemblies. Because installutil.exe is not available on every system I want to include it in my setup package. Is it allowed to distribute installutil.exe?
Tags : contentbug

abrarahmad
Answer please
Can someone from Microsoft please answer Xiphos question regarding if it is allowed to distribute installutil.exe with packages? Thanks. Abrar.
Tags : contentbug

Thomas Brislinger
use search or follow link

well ... you do need the .net framework for your service, right?

the installutil is included in the redistributables!

http://msdn.microsoft.com/en-us/library/50614e95(VS.80).aspx

i hope this answers your question! :)


figuerres
not working on server 2008! throws an exception and rollsback

here is the error:

An exception occurred during the Install phase.
System.Security.SecurityException: The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.

happens with autolog false or true.

the service has no event log code.

so ither server 2008 is to secure or the installutill.exe needs a patch.


NBridgeH2O
windows server 2008 - installutil SecurityException fix
You need to run this with elevated privileges. I'm not aware of the shortcut yet, but just by messing around, you can right click on C:\windows\Systemwow64 (or system32)\cmd.exe and select Run As Administrator.

Then change directories and run installutil -i as you would normally.

AL20071234
windows server 2008 seems to use the 32 bit installutil
During install, it throws an exception (during customs action) and in the event log says "The error code is 2869". If I remove all the customs action, I can install the service and manually use the installutil under C:\Windows\Microsoft.NET\Framework64\v2.0.50727 to register the service. How can I make the installer to use the correct installutil?
Tags : contentbug

Page view tracker