School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 307,109 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,002 people online right now. Registration is fast and FREE... Join Now!




Setup and Deployment with Prerequisites Included in VB.Net 2008

 
Reply to this topicStart new topic

> Setup and Deployment with Prerequisites Included in VB.Net 2008

motcom
Group Icon



post 17 Sep, 2009 - 10:55 PM
Post #1


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.

Go to the top of the page
+Quote Post


Register to Make This Ad Go Away!

KeesvanderSluis
*



post 25 Sep, 2009 - 01:25 PM
Post #2
What is missing? This is just creating an empty installer with no application added.
What about the primary output setting??

Regards,
Kees van der Sluis

This post has been edited by KeesvanderSluis: 25 Sep, 2009 - 01:26 PM
Go to the top of the page
+Quote Post

motcom
Group Icon



post 27 Sep, 2009 - 10:38 PM
Post #3
Yes,
quite right,

To add the project output,
1. Right Click on the Setup and Delpoyment Project.
2. Select add and then Project Output.
3. Select the "MainProject"

For this Tutorial we just need the "Project Output" in the list of Outut Types, but if you work with larger projects, you want to include"Localized Reasources", "Content Files" and "Documentation Files".

Also if your Proram has more than one Project, you want to repeat this step for each project.

smile.gif
Go to the top of the page
+Quote Post


Fast ReplyReply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 


Lo-Fi Version Time is now: 11/21/09 12:56PM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month