Page 1 of 1

Setup and Deployment with Prerequisites Included in VB.Net 2008 Rate Topic: -----

#1 motcom  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 290
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Post icon  Posted 17 September 2009 - 11:55 PM

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.

Is This A Good Question/Topic? 2
  • +

Replies To: Setup and Deployment with Prerequisites Included in VB.Net 2008

#2 KeesvanderSluis  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 13-July 09

Posted 25 September 2009 - 02:25 PM

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 September 2009 - 02:26 PM

Was This Post Helpful? 0
  • +
  • -

#3 motcom  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 290
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Posted 27 September 2009 - 11:38 PM

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.

:)
Was This Post Helpful? 1
  • +
  • -

#4 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 463
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Posted 26 May 2010 - 05:15 AM

now if some one tell me how to make a shortcuts in start menu and desktop :)
Was This Post Helpful? 0
  • +
  • -

#5 motcom  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 290
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Posted 26 May 2010 - 06:27 AM

Well to place a shortcut is quite easy.

Click on the Setup Project, then locate the "File System Editor" in the Solution Explorer window and click it.

A window will open having 3 Folders "Application Folder", "User's Desktop" and "User's Programs Menu"

Double Click on "User's Desktop" and the Right Hand window should be empty, right click anywhere on the white area on the Right Hand window and select "Create New Shortcut"

A Window will popup asking you what to select, Doulbe Click on "Application Folder" and select "Primary Output from ..."

Next give the shortcut a name and whilst the shortcut is selected, check the properties box and select the icon. The Icon should be included in your Project.
Was This Post Helpful? 2
  • +
  • -

#6 Guest_I, the Deceiver*


Reputation:

Posted 04 August 2010 - 07:10 PM

I'm having trouble actually getting the icon on my shortcut
I'm certain that i've simply omitted something obvious
Each time i select an icon (whether from a .ico file, or the one embedded in the actual output application) It says the shortcut cannot be created, it can't build it.
I'm not really sure what the problem is. So my application builds fine, but the desktop shortcut must be the default *(None)* or else it refuses to build the program
This occurs with any program shortcut, not just those on the desktop

any suggestions?
Was This Post Helpful? 0

#7 motcom  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 290
  • View blog
  • Posts: 1,371
  • Joined: 16-June 08

Posted 05 August 2010 - 12:18 AM

Did you include the Icon Project?
Was This Post Helpful? 0
  • +
  • -

#8 Guest_Akhil Gupta*


Reputation:

Posted 28 December 2010 - 12:29 AM

View Postmotcom, on 17 September 2009 - 10:55 PM, said:

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.

Was This Post Helpful? 0

#9 rassalas  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 17-May 11

Posted 17 May 2011 - 04:46 PM

I found this tutorial very helpful when the comments were included. and to that end I would point out that this will produce a .MSI file that is all one needs to install on another computer. This is the holy grail all you people out there trying to figure out how to deploy. after following this tutorial, look in you setup projects folders for the .MSI file. The author left that kind of unsaid and what he does say is confusing, ie "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""
Was This Post Helpful? 0
  • +
  • -

#10 kryton46  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 6
  • View blog
  • Posts: 44
  • Joined: 29-December 08

Posted 28 August 2011 - 05:45 AM

View Postrassalas, on 17 May 2011 - 04:46 PM, said:

I found this tutorial very helpful when the comments were included. and to that end I would point out that this will produce a .MSI file that is all one needs to install on another computer. This is the holy grail all you people out there trying to figure out how to deploy. after following this tutorial, look in you setup projects folders for the .MSI file. The author left that kind of unsaid and what he does say is confusing, ie "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""


Use [EgeUE-MSI-to-EXE-Trail.exe] to then create a stand-alone .exe instead of distributing an .msi file. It merges the setup.exe and .msi into one executable the user understands.

Google the program, it's available as trial but that's more than enough.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1