4.3. Deploying the Application


Visual Studio 2005 makes the deployment of Windows applications to your users extremely easy and painless, all through a new feature known as Click-Once.

Smart Clients

ClickOnce was designed specifically to ease the deployment of smart clients.

A smart client is basically a Windows application that leverages the system's local resources and is able to intelligently connect to distributed data sources (such as web services) as and when needed.

The Library Application that you've been building in this chapter is an example of a smart client. While today a lot of companies are deploying web applications (due to their ubiquitous access), network latencies and server delays are some of the problems that are preventing developers from reaping the full benefits of the Web. Common frustrations over web applications include slow response time from web sites and limited functionality (due to the stateless nature of the HTTP protocol). As such, a smart client aims to reap the benefit of the rich functionality of the client (Windows) while at the same time using the power of web services in the backend.


To illustrate how ClickOnce works, you will publish the Library Application (LibraryApp) that you have written and see how easy it is to deploy it using a web server. Furthermore, ClickOnce has the added benefit of ensuring that applications that you deploy will automatically check for the latest update (you can configure the application to check every time before it runs, or check at regular time intervals) on the server, if one is available, as you'll see in "Automatic Updating," later in this capter.

4.3.1. Publishing the Application

You can now publish (deploy) a Windows application through a disk, shared folder, FTP server, or web server, and automatically ensure that users are always using the latest version of the application.

  1. To run the ClickOnce Publish Wizard, go to Build Publish LibraryApp on the Visual Studio menu, as shown in Figure 4-32. The "Where do you want to publish dialog box will appear.

    Figure 4-32. Publishing the LibraryApp Windows application


  2. The "Where do you want to publish" dialog box gives you four options for where to publish the application: disk, shared folder, FTP server, or web server. For this project, you will publish the application through the IISweb server (see the sidebar "Installing IIS on Your Computer" on how to install IIS on your Windows XP computer).

    Installing IIS on Your Computer

    If you wish to use IIS to deploy your Windows applications, you must install IIS. By default, Windows XP does not install IIS, so you need to retrieve your Windows XP Installation CD and then use Control Panel Add or Remove Programs Add/Remove Windows Components Components: Internet Information Services (IIS) to add IIS yourself.


    In the "Specify the location to publish the application" text box, create a directory for the application by entering the following link: http://localhost/LibraryApp (see Figure 4-33). Click Next. The "Will the application be available offline?" dialog will appear.

    Localhost is the name of the web server installed in your local computer.


    Figure 4-33. Specifying the path to publish the folder


  3. ClickOnce allows the user to install an application locally on the client, or to download every time it is needed. In the "Will the application be available offline?" dialog, select "Yes," as shown in Figure 4-34, and then click Next. The "Ready to Publish!" dialog will appear.

    Figure 4-34. Choosing the mode in which the application should be run


  4. That's it! You are now ready to publish the application from your web server. In the "Ready to Publish!" dialog shown in Figure 4-35, click Finish to create the web page that users will link to in order to install the application.

    Figure 4-35. The wizard is ready to publish the application


  5. You should see the web page shown in Figure 4-36. Your users can now use the URL for that page to install the application on their own machines.

    Figure 4-36. Installing the application through the web server


  6. To install the application on your own machine, click the launch link in the page.

    Click the Install button to install the prerequisites, if your machine does not have them.


  7. You will be prompted with a security warning such as the one shown in Figure 4-37. Click Install to install the application onto your machine.

    You can eliminate this security warning by setting the relevant security policy. Refer to the MSDN Help Topic "Code Access Security for ClickOnce Applications" for more information. Also, check out the help topic "How to: Sign ClickOnce Application and Deployment Manifests" (http://msdn2.microsoft.com/library/che5h906(en-us,vs.80).aspx) for more information.


    Figure 4-37. Installing the application


  8. You will now see that the LibraryApp application is launched automatically. Alternatively, you can launch the LibraryApp application from Start Programs LibraryApp LibraryApp.

The ClickOnce installation does not require you to have administrator rights to install the application.




Visual Basic 2005 Jumpstart 2005
Visual Basic 2005 Jumpstart
ISBN: 059610071X
EAN: 2147483647
Year: 2005
Pages: 86
Authors: Wei-Meng Lee

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net