Microsoft KB Archive/324733

= HOW TO: Distribute the .NET Framework with a Visual Studio .NET Deployment Project =

Article ID: 324733

Article Last Modified on 3/29/2007

-

APPLIES TO


 * Microsoft .NET Framework 1.0
 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft Visual Studio .NET 2002 Academic Edition
 * Microsoft .NET Framework 1.1
 * Microsoft Visual Studio .NET 2003 Academic Edition
 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Professional Edition

-



This article was previously published under Q324733



IN THIS TASK

 * SUMMARY
 * Distribution of the .NET Framework
 * Requirements to Install the .NET Framework
 * Install the .NET Framework Manually
 * Use Setup.exe to Distribute the .NET Framework with Your Visual Studio .NET Application
 * Prepare Your Deployment Project for Use with the Setup.exe Bootstrapping Application Sample
 * Customize the Settings.ini File
 * REFERENCES



SUMMARY
This step-by-step article describes how to distribute the .NET Framework with your application.

When you deploy a Microsoft .NET-connected application, the destination computer must have the .NET Framework installed. If the .NET Framework is not installed, the application cannot run. A Microsoft Visual Studio .NET setup and deployment project does not automatically install the .NET Framework. However, there are ways to make sure that the .NET Framework is installed before your application is installed.

back to the top

Distribution of the .NET Framework
When you deploy Visual Studio .NET applications, the .NET Framework must be installed on the destination computer. When you create a Windows Installer setup package by using Visual Studio .NET deployment tools, the installer includes a default start condition (MsiNetAssemblySupport). This start condition verifies that the .NET Framework is installed on the destination computer. If the .NET Framework is not found on the destination computer, the installation is stopped and you receive the following error message:

This setup requires the .NET Framework. Please install the .NET Framework and run this setup again

You cannot include the .NET Framework in a Windows Installer setup package that you create by using Microsoft Visual Studio .NET deployment tools. The .NET Framework must be installed separately. You can deploy the .NET Framework on the destination computer in the following two ways:
 * Instruct the user to manually install the .NET Framework executable before installing the Visual Studio .NET application.
 * Download the Setup.exe Bootstrap sample (available on the Microsoft Developer Network (MSDN) site). Use the Setup.exe to install the .NET Framework redistributable package (Dotnetfx.exe). After the .NET Framework is installed, this Setup.exe starts the Windows Installer package for your application.

back to the top

Requirements to Install the .NET Framework
There are basic configuration requirements that must be met to install Dotnetfx.exe. You must have one of the following operating systems and Microsoft Internet Explorer 5.01 or later installed on your computer:
 * Microsoft Windows 98
 * Microsoft Windows 98 Second Edition
 * Microsoft Windows Millennium Edition (Windows Me)
 * Microsoft Windows NT 4.0 (Workstation or Server) with Service Pack 6a
 * Microsoft Windows 2000 (Professional, Server, or Advanced Server) with the latest Windows service pack and critical updates available from the Microsoft Security Web site
 * Microsoft Windows XP (Home or Professional)
 * Microsoft Windows Server 2003 family

Depending on your application requirements, install one (or both) of the following:
 * MDAC 2.6 or later for data access, available from the Universal Data Access Web site
 * Core WMI for Windows instrumentation, available from the Download Center

back to the top

Install the .NET Framework Manually
 Obtain the .NET Framework redistributable package:  To download the .NET Framework redistributable package, visit the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/netframework/aa731542.aspx

-or- Install the redistributable file from the Windows Component Update CD-ROM or DVD-ROM. It is located in the Wcu\dotNetFramework folder.  Run Dotnetfx.exe to install the .NET Framework. If the Visual Studio .NET application requires it, you may add a start condition to the Windows Installed package to verify that MDAC version 2.6 or later is installed.</ol>

For additional information about .NET Framework Redistributable location, click the following article number to view the article in the Microsoft Knowledge Base:

308488 INFO: Download and Install the .NET Framework

back to the top

Use Setup.exe to Distribute the .NET Framework with Your Visual Studio .NET Application
You may want to package your application so that the .NET Framework redistributable package is installed first, and then starts the Windows Installer package (.msi file) for your Visual Studio .NET application. The Setup.exe bootstrapping application is a sample that is available on the MSDN site to demonstrate how to do this. Change the Settings file (Settings.ini) to specify the locations of the redistributable package and your application installer. For more information about how to include the .NET Framework with your package, visit the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/netframework/aa731542.aspx

back to the top

Prepare Your Deployment Project for Use with the Setup.exe Bootstrapping Application Sample
To use the Setup.exe bootstrapping application sample with an installer that you created by using Visual Studio .NET deployment tools, you must prepare the deployment project for this scenario to work correctly. By default, a deployment project includes a Windows Installer bootstrapping application. However, the .NET Framework redistributable also includes a Windows Installer bootstrapping application. You must remove the installer bootstrapping application from your project. To do this, follow these steps:
 * 1) In Solution Explorer, click the deployment project.
 * 2) On the Project menu, click Properties.
 * 3) In the Property Pages dialog box, set the Bootstrapper property to None.
 * 4) On the Build menu, click Build Solution.
 * 5) Copy the Windows Installer file (.msi) to the deployment location (for example, a folder on a CD-ROM or a network share).
 * 6) Copy the Setup.exe bootstrapping application sample and the Settings.ini file that you downloaded in the &quot;Use Setup.exe to Distribute the .NET Framework with Your Visual Studio .NET Application&quot; section to the deployment location, and then follow the steps in the &quot;Customize the Settings.ini File&quot; section

back to the top

Customize the Settings.ini File

 * 1) Open the Settings.ini file in a text editor (such as Notepad).
 * 2) Locate the Msi=FxCopSourceSetup.msi entry, and then replace the default path with the path of your .msi file, as in the following examples:
 * 3) * When mySetup.msi is located on the local computer in the same folder as Setup.exe, the path is Msi=mySetup.msi.
 * 4) * When the mySetup.msi is located on a network share in a folder named myProjectFolder, the path is Msi=\\myNetworkShare\myProjectFolder\mySetup.msi.
 * 5) * When mySetup.msi is located in a folder named myInstallerFiles, on the same CD-ROM as Setup.exe, the path is Msi=myInstallerFiles/mySetup.msi.
 * 6) Locate the FxInstallerPath=c: entry. Replace the default path with the correct path of the .NET Framework redistributable package, Dotnetfx.exe, as in the following examples:
 * 7) * When Dotnetfx.exe is located on the local computer in a folder named myProjectFolder, the path is FxInstallerPath=c:\myProjectFolder\.
 * 8) * When Dotnetfx.exe is located on a network share in a folder named myProjectFolder, the path is FxInstallerPath=\\myNetworkShare\myProjectFolder\.
 * 9) * When Dotnetfx.exe is located in a folder named myExecutables, on the same CD-ROM as Setup.exe, the path is FxInstallerPath=myExecutables/.
 * 10) To verify what build number and language version of the .NET Framework is installed, specify the language in the Settings.ini file. By default, if you do not specify a language for the LanguageDirectory variable, Setup.exe verifies that the English version is installed.
 * 11) Save the Settings.ini file.

back to the top

<div class="references_section">