Deploying a .NET Windows Application
In 18 Steps!
In the heat of design, development and testing of our new .NET
Windows Application, we rarely think about the final step --
Deployment. But sooner or later, the time will come when the
application needs to be deployed to user machines. According to the
help files in Visual Studio .NET, there are 18 steps involved in the
deployment process. My goal here to review those steps and add
some personal comment. In order to see the original source of these
steps, please follow this link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vbtskCreatingInstallerForYourApplication.asp Step
1: Create a Windows application This is the application we
intend to deploy. Step 2: Create a deployment project This
should be inside the same solution where application has been built. Step
3: Add the Windows application to the installer Once this step
is done, take a moment to familiarize yourself with Properties of the
setup project. Certain values in the Properties window should
not be ignored or left as default. Otherwise, you'll have to go
back and customize them before final deployment. Step 4: Deploy
the application This step is for deploying the application on
the development computer. Although the documentation suggests
that you may skip this step, I highly recommend that you don't skip
it! Think of this as part of testing the deployment process; you
may discover certain aspects of deployment that -- in my opinion
-- should be dealt with as soon as possible. Step 5: Create
shortcuts The instructions don't tell you how to open the File
System Editor. Try View-Editor-File System. Also, the
instructions go as far as placing a short on user's Desktop. I
think while we are there, we might as well create a shortcut for
user's Programs Menu. However, in order to do that, you must
repeat the entire step and create a 2nd shortcut and drag it to the
Programs Menu. In other words, you cannot copy the 1st shortcut
(which is on the Desktop) to the Programs Menu. Step 6: Create
file associations It's good to know that we can do this, but for
most applications, this might not be needed. Step 7: Add a
registry entry Again, I would stay away from touching the
registry as much as possible. Step 8: Add a custom installation
dialog box I think the title of this step needs a little
clarification. The purpose of this step is to create a dialog
with one or more checkboxes, in order to allow the user to decide
whether or not a certain action should be taken (with no harm to the
general functionality of the application). For instance, user
may choose to install sample documentations for the application. Step
9: Add a Samples folder The documentation appears to suggest
that this step is a continuation of the previous one (where optional
features are selected via one or more checkboxes). Actually,
this may be a necessary step even though there is no custom dialog or
none of the options in the custom dialog have been selected. For
example, you application may need certain subfolders on the user
machine that are necessary for the operation. This is where
you'd specify those necessary subfolders. Step 10: Create sample
files for the application This is a useful step for creation of
certain files (to be placed inside the subfolders created in the
previous step). Step 11: Add the samples to the installer This
is a continuation of the previous step. Note, however, that if
you define a subfolder but leave it empty, it won't be created on the
target computer. (This could be a bug, but at least as of this
writing, it was happening.) Step 12: Add a launch condition This
could be for checking the proper version of Internet Explorer on the
user computer (as described in the documentation) or even the version
of Windows itself (in case the application doesn't run on all versions
of Windows). In addition, note that .NET Framework
is already part of the Launch Conditions on the Target Machine and
should remain as such. Step 13: Set optional properties for the
deployment project Actually, even without any optional
properties, this is a required step since you'll Build
the installer project here. Step 14: Install on your development
computer This is technically the same as Step 4 (although under
a different title). Step 15: Deploy to another computer The
instructions aren't accurate as to where exactly the MSI file (and
other distribution files) will be located, before there copied from
the development machine to the distribution network or CD-ROM. These
files are under deployment project folder\debug
(not under documents and settings).
See Step 2 above. There are at least three files that will need to
be copied to the distribution network or CD-ROM: * The MSI file *
Setup.EXE * Setup.INI Step 16: Copy the above files (and their
subfolders, if any) to the distribution network or CD-ROM. Actually,
if the application is small enough and the above three files fit on a
floppy disk, that would work too. Step 17: On the target
computer, open the distribution medium and double click the Setup.EXE
file. Step 18: Test the installation Verify that
shortcuts are created on the Desktop
and/or under Program Menu, then double
click the shortcut to launch the application on the target computer. |