O'Reilly logo

Visual Basic 2005 Jumpstart by Wei-Meng Lee

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

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.

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.

    Publishing the LibraryApp Windows application

    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).

    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.

    Tip

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

    Specifying the path to publish the folder

    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.

    Choosing the mode in which the application should be run

    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.

    The wizard is ready to publish 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.

    Installing the application through the web server

    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.

    Tip

    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.

    Tip

    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.

    Installing the application

    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.

Tip

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required