Walkthrough: Deploying a Visual C++ Application By Using the Visual C++ Redistributable Package
Describes how to use the Visual C++ redistributable package to deploy a Visual C++ application.
To deploy an application by using the Visual C++ Redistributable Package
Create and build a new MFC application by following steps 1 through 3 of the procedure in Walkthrough: Deploying a Visual C++ Application By Using the Visual C++ Redistributable Package.
Create a file that is named setup.bat and add the following commands. You need to change MyMFCApplication to the name of the project that you used in step 1.
@echo off vcredist_x86.exe mkdir "C:\Program Files\MyMFCApplication" copy MyMFCApplication.exe "C:\Program Files\MyMFCApplication"
Perform the following steps to create a self-extracting setup file:
Run iexpress.exe from a command window or the Run window.
Select Create new Self Extraction Directive file and click Next.
Select Extract files and run an installation command and click Next.
Enter the name of your MFC application into the text box and click Next.
On the Confirmation prompt page, select No Prompt and click Next.
On the License agreement page, select Do not display a license and click Next.
On the Packaged files page, add the following files and then click Next:
Your MFC application (.exe).
vcredist_x86.exe. You can find this file in the \Microsoft SDKs\Windows\v7.0A\Bootstrapper\Packages\vcredist_x86 folder under your Program Files folder.
The setup.bat file that you created in step 2.
On the Install Program to Launch page, enter the following in the Install Program text box and click Next:
cmd.exe /c "setup.bat"
On the Show window page, select Default and click Next.
On the Finished message page, select No message and click Next.
On the Package Name and Options page, enter a name for your self-extracting setup file, ensure that the Store files using Long File Name inside Package option is selected, and click Next. The file name must end in Setup.exe (for example, MyMFCApplicationSetup.exe).
On the Configure restart page, select No restart and click Next.
On the Save Self Extraction Directive page, select, Save Self Extraction Directive (SED) file and click Next.
On the Create package page, click Next.
Run the self-extracting setup file on a second computer that does not have the Visual C++ libraries.
Copy the self-extracting setup file that you created in step 3 to the second computer.
Run the self-extracting setup file on the second computer. Follow the steps that are provided by the setup wizard to complete the installation.
Run the MFC application. The self-extracting setup file installs the MFC application that is in the folder that you specified in step 2.
The application runs successfully because the Visual C++ Redistributable Package installer is included in the self-extracting setup file.