# How to create setup file using Visual Studio 2005



## Adam Cruge1 (Aug 17, 2008)

I am using Visual Studio 2005.I am learning Visual Basic.
 And today I made a very simple project.I also created .exe file. But
it does not run in other computer where Visual Studio is not installed.
I want to run it on the computer where Visual Studio is not installed.
And I also want to create its set-up file like the one of commercial 
software.
*Please tell me step by step guidance as to how to do so....*


----------



## QwertyManiac (Aug 17, 2008)

Wherever you deploy it, the host machine NEEDS the .NET runtime library available. Matching the version your project was built for/with.


----------



## RCuber (Aug 17, 2008)

Adam Cruge1 said:


> I am using Visual Studio 2005.I am learning Visual Basic.
> And today I made a very simple project.I also created .exe file. But
> it does not run in other computer where Visual Studio is not installed.
> I want to run it on the computer where Visual Studio is not installed.
> ...



first off .. the target system requires .NET framework to be installed. As you are doing the project in VS 2005, the target system requires .NET framework 2.0 to be installed. 

Visual studio has the built in feature to create deployment (setup) project to be added to a existing project. 

Here are the steps. 
1.First open your windows application project. 
2. Goto File> Add > New Project
3. Select Other Project Types > Setup Project. 
 Give the project a suitable name i.e., the name you require to be displayed in add remove programs.

Now a new setup project is added into your solution. 

4. The File System Editor should have opened. if not then open it by using View > Editors > File System
5. Now you will have to add the project output to the application folder. 
Right click on Application Folder > Add > Project Output.Select Primary output and click ok.

5. If you want to put a shortcut to the desktop or to the program menu then right click on the project output the click "create shortcut to...." . Drag this into the "User's Desktop" or to the "User's Program Menu"

6. Now we need to enter the user information. 
    Select the setup project and press F4 to open the properties window.
You will see many user definable properties like Author, manufacturer etc etc.. Just enter the details as per your wish. 

7. Now if you want to bundle .NET framework with the setup then go to 
Project > Properties. > prerequisits , Check .NET framework 2.0. 
Select "Download prerequisits from the same location as my application. Click OK. 

8. Once the above things are done you can just right click on the setup project and click Build or Rebuild.  This will generate the nessary setup file for your project to be deployed. 

You can copy the setup files from 
Your Solution\Your setup project\Release\

There will be two files. One is .MSI and other is Setup.EXE then there will be a folder which has the .NET framework, setup.exe is a bootstrap executable, that means it will run on any system which doesnt have the prerequisits installed. If the system doesnot have .NET framework the the setup will automatically install it. 

DONOT run the installer from the .MSI it doesnot detect if the system has .NET framework or not.. always run the setup.exe. 

Also it will be a good idea to include Windows Installer 3.1 in the prerequisits as its nessary for .NET framework installer.

Hope you understood this.


----------



## Gigacore (Aug 17, 2008)

+1 for charan, but 

why don't u use free/shareware setup creators like InstallAnywhere and create install etc and include .NET framework install file along with the setup file and guide users to install .NET Framework before installing the original program ?


----------



## RCuber (Aug 17, 2008)

^^ I havent use any other setup programs.. One of the feature of the setup project in VS.NET is that it can detect the dependencies automatically and include the required assemblies. Also the setup.exe can download the prerequisits from the internet/local or from any 3rd party location. 

I will have to try using other tools and see if any are better


----------

