62 Part I Getting Started with Microsoft Visual Basic 2010
Deploying Your Application
Visual Studio helps you distribute your Visual Basic applications by providing several options
for deployment—that is, for installing the application on one or more computer systems.
Since the release of Visual Studio in 2002, Visual Basic applications have been compiled as
assemblies—deployment units consisting of one or more files necessary for the program
to run. Assemblies contain four elements: Microsoft intermediate language (MSIL) code,
metadata, a manifest, and supporting files and resources. Visual Studio 2010 continues to
offer this same basic deployment architecture, with some noteworthy improvements for
different platforms and application types.
How do assemblies actually work? First, assemblies are so comprehensive and self-describing
that Visual Studio applications don’t actually need to be formally registered with the
operating system to run. This means that theoretically a Visual Basic 2010 application can be
installed by simply copying the assembly for the program to a second computer that has the
correct version of the .NET Framework installed—a process called XCOPY installation, after
the MS-DOS XCOPY command that copies a complete directory (folder) structure from one
location to another. In practice, however, it isn’t practical to deploy Visual Basic applications
by using a copy procedure such as XCOPY (via the command prompt) or Windows Explorer.
For commercial applications, an installation program with a graphical user interface is usually
preferred, and it’s often desirable to register the program with the operating system so
that it can be uninstalled later by using Control Panel. In addition, it is often useful to take
advantage of the Web for an application’s initial deployment and to have an application
check the Web periodically for updates.
Although the advanced options related to deployment and security go beyond the scope of
this book, you should be familiar with your deployment options. To manage the deployment
process, Visual Studio 2010 supports two deployment technologies, ClickOnce and Windows
Installer.
Essentially, ClickOnce is a robust Web-based publishing technology that allows you to control
how applications are made available to users via the Internet, although ClickOnce installations
can also be distributed via CD-ROM. With ClickOnce, you can create an installation service
for Windows applications, Office solutions, or console applications that users can access on
their own with minimal interaction. With ClickOnce, you can specify prerequisites, such as
a particular version of the .NET Framework, and you can easily publish updates on a Web page
or a network file share to make improvements to your program. You can get started with
ClickOnce at any time by using the Publish command on the Build menu. And you can control
how ClickOnce works by setting properties using the Properties command on the Project
menu. (Click the Publish tab in the Project Designer for specific features .)