Вы находитесь на странице: 1из 7

VB.

Net Deployment ictsociety-kandy

Deploying Applications
Once an application is developed and if we want to distribute that application, we need to
deploy that. Deployment is the process where we create an executable file which can be
installed on any machine where the application can run. We can use the built-in
deployment feature that comes with Visual Basic to create a Windows Installer file - a .msi
file for the purpose of deploying applications.

Let's look at the process with an example. Let's assume we have a form with a TextBox
and a Button. When the Button is clicked the TextBox should display "This application is
Deployed". Let's name this application as Deploy. The code for the click event of the
Button looks like this:

Private Sub Button1_Click(By Val sender as System.Object, By Val e_


as System.EventArgs)Handles Button1.Click
TextBox1.Text="This application is Deployed"
End Sub

Next, we need to create an executable (exe) file for this application. To do that select
Build->Build from the main menu which builds Deploy.exe. Next, we need to create an
installer file for Deploy (which is the example) which is a file with .msi extension. To do
that, select File->Add Project->New Project which opens the new project dialogue. Select
"Setup and Deployment Projects" icon in the projects type box and Setup Wizard in the
templates box. It looks like the image below.

By : MMMUZAMMIL for ictsosiety http://www.ictsociety.9f.com 1


VB.Net Deployment ictsociety-kandy

Click OK to open the Setup Wizard. The Setup wizard window looks like the image below.

Click next on the above pane to take you to second pane in the Wizard. The new pane
allows us to create deployment projects both for Windows and Web Applications. Here,
select the radio button which says "Create a setup for Windows Application" as this is
deploying a windows application and click next. It looks like the image below.

Clicking next opens a new pane which has options like Deploying only primary
output from the project or both the project and source code or content files.
Check the checkbox which you want, in this case check the checkbox that says

By : MMMUZAMMIL for ictsosiety http://www.ictsociety.9f.com 2


VB.Net Deployment ictsociety-kandy

"Primary Output from Deploy" and click next. It looks like the image below.

Clicking next opens a new pane which asks if you want any additional files to be
added. If you wish, you can include other files, like an icon for the application. In
this example don't include any files and click next. It looks like the image below.

By : MMMUZAMMIL for ictsosiety http://www.ictsociety.9f.com 3


VB.Net Deployment ictsociety-kandy

Doing that brings up the last pane of the Setup Wizard which looks like the image
below. Click Finish on this pane.

By : MMMUZAMMIL for ictsosiety http://www.ictsociety.9f.com 4


VB.Net Deployment ictsociety-kandy

Clicking finish opens up a File System window which looks like the image below.

This window allows us to create shortcuts to the application on the desktop and in our
Programs Menu. To create a shortcut, right-click on the folder "User's Desktop" and select
"Create Shortcut to User's Desktop". Rename the shortcut to "Deployment". If we want a
shortcut to the application from our Programs Menu, right-click on "User's Program Menu"
folder and select "Create Shortcut to User's Program Menu". Right Click on Every
Displaying Folder Select ADD, then select the exe file in the BIN folder of your .NET
Application. Rename the shortcut to "Deployment". Once you are finished with it, click on
"Application Folder" and open it's properties. In the properties window set the property
"Always Create" to True. Set the same for "User's Desktop" and "User's Programs Menu"
folders. If you want any additional information to include with the set-up project, like the
manufacturer, author etc, click on Setup1 project and open it's properties. You can set
additional information here. Once your are done with it build the project by right-clicking
on Setup1 and selecting Build. This builds the application. The setup file is created in the
debug folder of Setup1 project.

Deploying Applications
Deploying the Application

To deploy the application we need to copy Setup1.msi file to the target machine. Once
copying is done, double-click that file which opens the Windows Installer which is a new
window which says "Welcome to Setup1 Setup Wizard". It looks like the image below
(mine was Setup7, yours will be Setup1).

By : MMMUZAMMIL for ictsosiety http://www.ictsociety.9f.com 5


VB.Net Deployment ictsociety-kandy

Click next to move to next window which allows us to specify the location where the
application should be installed. It looks like the image below.

Select the location for installation and click next. Clicking next installs the application. The
confirmation window looks like the image below.

By : MMMUZAMMIL for ictsosiety http://www.ictsociety.9f.com 6


VB.Net Deployment ictsociety-kandy

Now, double-click the newly installed Deployment.exe file to run and get the desired
result. You can select that from your Programs Menu or Desktop. That completes the
process of Deploying Applications.

Make sure the Target Machine on which the application will be installed supports Windows
Installer and .NET Framework.

Best of Luck

Copyright ©Reserved

TGKICT-KANDY

By : MMMUZAMMIL for ictsosiety http://www.ictsociety.9f.com 7

Вам также может понравиться