Share via


Setup.exe Bootstrapper Sample Operations

You do not need to be aware of how Setup.exe implements the operations it performs to use the Setup.exe Bootstrapper sample. Details regarding how Setup.exe performs specific operations are provided for developers who want to create a custom setup program that installs the .NET Framework with an application.

The Setup.exe Bootstrapper sample is responsible for automatically performing the following operations.

Detecting Whether the .NET Framework is Installed

Launching a Silent Installation of Dotnetfx.exe

Processing Common Error Codes During Installation

Calling the MSI Setup for an Application and Suppressing Reboot Until the Application is Installed

Detecting Whether the .NET Framework is Installed

The Setup.exe Bootstrapper sample demonstrates the code used to wrap a setup program to check if the .NET Framework is installed. The code checks for a specified version number of the .NET Framework in the following registry key.

HKLM\SOFTWARE\Microsoft\.NETFramework\policy\v1.0

The version number to check for is obtained from Dotnetfx.exe. The code performs a comparison between the build number in the registry key and the build number of the .NET Framework being hosted by the application. If there is not a matching build number in the registry key in this location, Setup.exe installs the version of the .NET Framework being hosted by the application.

Note that if you want Setup.exe to check for a build number and language version of the .NET Framework, you must specify the culture name of the language to check for in the Settings.ini file. If you do not specify a culture name, Setup.exe checks for the English language version by default. See the Using the Setup.exe Bootstrapper Sample with an Application topic for instructions on specifying a culture name.

Launching a Silent Installation of Dotnetfx.exe

Setup.exe uses the following command to launch a silent installation of Dotnetfx.exe.

dotnetfx.exe /q:a /c:"install /l /q"

A silent installation suppresses the display of all user interface and error messages returned by Dotnetfx.exe and Install.exe, which is contained within Dotnetfx.exe. Specifying the /q:a and /q options for a silent installation allows for a standardized user installation experience. Specifying the /l option creates a setup log file, Netfx.log, in the %temp% directory where all errors are logged.

Processing Common Error Codes During Installation

The following table describes the common errors that are processed by the Setup.exe Bootstrapper sample.

Error Default text

3010

Setup requires a reboot. Would you like to reboot now?

Reboot is required.

8192

Setup requires a reboot. Would you like to reboot now?

A computer reboot is required following the installation of Windows Installer.

4101

Another instance of setup is already running.

If another instance of setup is running, it will be allowed to continue and the current installation cannot proceed.

4097

You do not have the permissions necessary to install this application. Please contact your administrator.

On Windows NT, you must have administrator privileges to (un)install.

1633

Your computer is not configured properly to run this application. Please contact support.

Invalid platform.

All other errors

Setup has encountered errors. Installation cannot proceed.

A fatal error occurred during setup. The installation of Dotnetfx.exe cannot proceed.

Calling an MSI Setup for an Application and Suppressing Reboot Until the Application is Installed

The following command calls the MSI setup for the host application myapp.msi. The REBOOT=ReallySuppress option suppresses a computer reboot until myapp is finished installing.

msiexec /i myapp.msi REBOOT=ReallySuppress

Note that the Setup.exe Bootstrapper sample does not need to check for error codes generated by the host application, myapp, because this is not a silent install and all errors are displayed to the user through the Windows Installer user interface.

See Also

Concepts

Creating a Single Setup Project to Install a .NET Framework Application and Dotnetfx.exe
Using the Setup.exe Bootstrapper Sample with an Application
Dotnetfx.exe Deployment Scenarios
Minimum Configuration Requirements

Other Resources

Redistributing the .NET Framework