This tutorial is based on Setup and Deployment and not Click Once technology using visual basic 2008.
One of the less talked about and confusing things are Setup and Deployment.
As most people know, a dot net application requires the relevant dot net framework to be installed on the client machine and most probably the windows installer.
I used visual basic 2008 professional edition with service pack 1.
This Tutorial will not apply to express editions.
This tutorial will also show you how to make a Setup and Deployment package which includes the Prerequisites and installs them from the same location as the Application.
We will create a Simple Windows Forms project that will use the dot net framework 3.5 and make a setup and deployment package that will install our Windows Forms Project.
Beginning Make a Windows Forms Project
To start off with we need to Create a project and call it “MainProject.”
1. Go to Start, Programs, Microsoft Visual Studio 2008 and Microsoft Visual Studio 2008
2. Click on Create Project
3. Select Windows Forms Application
4. Enter "MainProject" as your Project Name
Configure “MainProject” to use the Dot Net Framework 3.5
1. In the solutions explorer, find the "MyProject" folder under "MainProject" and double click on it.
2. A window will show your Application Settings etc. Find the "Compile Tab" and Click on it.
3. Scroll down a bit and find the button that says "Advanced Compile Options" and Click on it.
4. At the bottom is a setting called "Target Framework (all configurations)". Make sure it’s set to ".Net Framework 3.5"
Good, now that we have our Forms Project, we can build it.
Add a Setup Project
Now we will add a New Project to our solution.
1. In the Solution Explorer (normally on the right hand side) right click on the solution (very first item) and select "add new project".
2. In your project types, "select other project types", and "setup and deployment".
3. Click on Setup Project.
4. Enter "SetupProject" for you Project Name.
Good, the setup project should be visible in the Solution Explorer.
Configure the “SetupProject” to include the Prerequisites
Now we will configure our Setup Project to include the prerequisites
1. In the solution Explorer search for "SetupProject" and right click on it.
2. Select Properties
3. Click on "Prerequisites".
4. The first check box, "Create setup program to install prerequisites components" on top should be ticked, if not, tick it.
5. Now make sure that you tick "Windows Installer 3.1" and ".Net Framework 3.5" in the "Choose which Prerequisites to install" list.
6. Further down in the window there are 3 options. Make sure the "Download prerequisites form the same location as my application" is selected.
7. Close the window.
8. Close the Properties window.
Setup Settings
Now there are some other settings that are up to you to change.
Make sure you clicked on the "SetupProject" in the solution explorer.
In the properties toolbox, you can edit the "AddRemoveProgramsIcon", the "Author", "Descriptions" etc.
You should also see a couple of icons just above the solution explorer.
There is one icon that says "User Interface Editor" if you hover your mouse over it.
If you click on it, you will see the available forms that will be shown during installation.
You can click on each form and configure its settings to your need.
E.g. Banner Picture, Copy Right warning, Welcome Messages etc.
Testing
Now that we have all the basic required settings, we can test the application.
Save the Solution, if you haven’t done so already, by clicking on file, and save all. Note where you saved the application to, I will presume in my case "C:\MainProject"
1. Now build your solution
2. Find "SetupProject" in the solution explorer and right click it.
3. Select Build
4. Browse to your project folder in my case "C:\MainProject" locate "SetupProject" and double click on it.
5. Find the debug folder and double click on it.
6. Finally, this is where your application installation files are located. To test it, double click "setup.exe"
Note if you want to install this application on another machine, you will need ALL the files in the debug folder.