Deploying Applications in VB.NET: Part 1/2 - What is Microsoft Windows Installer? (Page 2 of 4 )
Windows Installer is an installation and configuration service shipped with Microsoft Windows .NET Server family, Windows XP, Windows 2000, and Windows Me. The installer is also provided as a service pack to Microsoft Windows NT version 4.0, Windows 98, and Windows 95.
An installation package contains all of the information that the Windows Installer requires to install or uninstall an application or product and to run the setup user interface. Each installation package includes an .msi file, containing an installation database, a summary information stream, and data streams for various parts of the installation. The .msi file can also contain one or more transforms, internal source files, and external source files or cabinet files required by the installation.
Windows Installer allows you to roll back the installation depending on some conditions and returns the computer to its original state. It also supports self-repair, which could be used to reinstall missing file(s). Sounds great doesn't it? Well, let's see it in action!
Creating a Windows Application Let's create a small Windows application, which will constantly display the current time on a form. To implement this, open Visual Studio.Net and create a new Windows application project, which we will call "MyClock". Click OK:
In the form design window, add a label control. Change the label controls name property to lbl_time. Add a timer control to the form. Change the timer controls interval property to 1000.
In the form design window, double click the form to open the Form1_Load procedure and enter the following line of code:
Timer1.Enabled = True ' this shall start the timer
In the form design window, double click on the timer control to open the Timer1_Tick procedure and type:
lbl_time.Text = TimeOfDay 'This shall display current time
Our digital clock application is ready to test. Built the application and run it to make sure our application is running properly before we start deploying this application.
Adding the Deployment Project Now that our application is coded and running fine, we need to think how we are going to distribute the application. Open the solution explorer, right click the solution and select Add, then New Project. The same action could be achieved from the File menu as well.
In the Add New Project window, select Setup and Deployment Projects from the project types. Also, select Setup Project from the Templates list. Change the name to MyClockSetup, and select the location where you want to store your project file(s).
Change this location to the main application project folder. This will ensure that all project and setup file(s) are created in folders under your main project folder.
Click OK. The Setup and Deployment project will be added to your existing project. Clicking OK will also open the File System window (we will go through that in a moment).
Select the MyClockSetup project from the Solution Explorer and open the properties window. Change the following properties: