Walkthrough: Deploying Your Program (C++)
Now that you've created your application by completing the earlier related walkthroughs, which are listed in Using the Visual Studio IDE for C++ Desktop Development, the last step is to create an installer so that other users can install the program on their computers. To do this, you'll add a new project to your existing solution. The output of this new project is a setup.exe file that will install your app on another computer.
This walkthrough shows how to use Windows Installer to deploy your application. You can also use ClickOnce to deploy an application. For more information, see ClickOnce Deployment for Visual C++ Applications. For more information about deployment in general, see Deploying Applications and Components.
Prerequisites
This walkthrough assumes that you understand the fundamentals of the C++ language.
It also assumes that you have completed the earlier related walkthroughs that are listed in Using the Visual Studio IDE for C++ Desktop Development.
This walkthrough cannot be completed in Visual Studio Express 2012 for Windows Desktop or Visual Studio Express 2012 for Windows 8.
If you haven’t already done so, download InstallShield Limited Edition (ISLE), as described in the steps later in this article. ISLE is free for Visual Studio developers and replaces the functionality of the setup and deployment project templates in earlier editions of Visual Studio.
To install the ISLE setup and deployment project template
When you are connected to the Internet, on the menu bar, choose File, New, Project to open the New Project dialog box.
In the left pane of the dialog box, expand the Installed, Templates, and Other Project Types nodes, and then select Setup and Deployment. In the center pane, select Enable InstallShield Limited Edition and then choose the OK button.
Follow the instructions to install InstallShield Limited Edition for Visual Studio (ISLE).
After you have downloaded, installed, and activated ISLE, close Visual Studio and re-open it.
On the menu bar, choose File, Recent Projects and Solutions, and then choose the Game solution to reopen it.
To create a setup project and install your program
Change the active solution configuration to Release. On the menu bar, choose Build, Configuration Manager. In the Configuration Manager dialog box, on the Active solution configuration drop-down list, select Release. Choose the Close button to save the configuration.
On the menu bar, choose File, New, Project to open the New Project dialog box.
In the left pane of the dialog box, expand the Installed, Templates, and Other Project Types nodes, and then select Setup and Deployment. In the center pane, select InstallShield Limited Edition Project.
Enter a name for the setup project in the Name box. For this example, enter Game Installer. In the Solution drop-down list, select Add to solution. Choose the OK button to create the setup project. A Project Assistant (Game Installer) tab opens in the editor window.
At the bottom of the Project Assistant (Game Installer) tab, choose the Application Information link.
On the Application Information page, specify your company name as you want it to appear in the installer. You can use your own company name, or for this example, use Contoso. Specify your application name; in this example, specify Game. Specify your company web address, or for this example, use https://www.contoso.com.
At the bottom of the Project Assistant (Game Installer) tab, choose the Installation Interview link.
On the Installation Interview page, under Do you want to display a License Agreement Dialog, select the No option button. Under Do you want to prompt users to enter their Company Name and User Name, select the No option button.
In Solution Explorer, expand the Game Installer project, expand the Organize Your Setup node, and then open the General Information page.
On the General Information (Game Installer) tab in the editor window, specify a Tag Creator ID, for example, regid.2012-12.com.Contoso.
In Solution Explorer, under the Game Installer project, expand the Specify Application Data node, and then open the Files page.
On the Files (Game Installer) tab in the editor window, under Source computer’s files, open the shortcut menu for Primary Output From Game and choose Copy.
Open a shortcut menu in the space under the Name column in Destination computer’s files, and choose Paste. A new item named Game.Primary Output appears.
In Solution Explorer, under the Specify Application Data node, open the Redistributables page.
On the Redistributables (Game Installer) tab in the editor window, select the Visual C++ 11.0 CRT (x86) check box.
On the menu bar, choose Build, Build Solution to build the Game project and the Game Installer project.
In the solution folder, locate the setup.exe program that was built from the Game Installer project, and then run it to install the Game application on your computer. You can copy this file to install the application and its required library files on another computer.
You can set many options in the setup project to suit your requirements. For more information, in Solution Explorer, under the Game Installer project, open the Getting Started page and then choose the F1 key to open the ISLE help library.
Next Steps
Previous:Walkthrough: Debugging a Project (C++)