Ever imagined how the setup files are made? i was curious too. Following is the procedure to create one in Visual Studio for VC++ projects.
Creating a setup file for your application using MS Visual Studio 2008
1. First build your application & generate the executable (.exe) file in “Release mode”.
2. While the solution file is still open in VS, create a deployment project (as shown in the fig 1):
File> New Project > Project types: select “Setup & Deployment”.
3. On the Templates pane on right side, select “Setup Project”. Give a suitable name & location for the project.
4. Instead of “creating a new solution”, select the “Add to solution” option from the drop down list. The window will look like this:
i. In the Add Project Output Group dialog box, select Primary Output.
ii. Select Release Win32 from the Configuration drop-down box, and then click OK.
6. In the Detected Dependencies, Visual Studio adds the dependent merge module (.msm) files for the Visual C++ libraries to the setup project.
7. IMP: if you have any other dll or lib files that your project depends on, add it to the Application folder by right clicking “Application folder” in the “File System” tab & Add > file.
8. Build the setup project to create the installer files (Setup1.msi and setup.exe). To do so, right click the Setup1 project node in Solution Explorer and select Build.
Visual Studio creates the installer files in the Release folder of your setup project.
9. Run the installer on a second computer that does not have the Visual C++ libraries.
i. Copy Setup1.msi and setup.exe to the second computer.
ii. Run setup.exe on the second computer. Follow the steps that are provided by the setup wizard to complete the installation.
Go to the installation folder & run the .exe. It should produce the desired output.
Reference: MSDN Library