beginners tutorial - Learn VB6
VB6 tutorial - Learn Advanced VB6
Analysis - System analysis and Design tutorial for Software Engineering
You are here: Visual
Basic > Advanced VB6 tutorial
> Chapter 15
Working With MTS Packages - The Package and Deployment Wizard
In order to add your component to an MTS package, you must first run the setup
program for your component on the machine running MTS. Visual Basic includes an add-in that can
be used to create setup programs. Although it can be used to provide distribution files and
a setup program for any Visual Basic project type, this chapter will focus on using it to
create the setup program for an ActiveX DLL. It must be noted that the term ‘package’
is meant in a different sense when in the context of the Package and Deployment Wizard.
If you have used the Setup Wizard from previous versions of Visual Basic, the
Package and Deployment Wizard will be very familiar:
STEP BY STEP
15.3 Add the Package and Deployment Wizard to the Add-Ins Menu
The first step in using the Package and Deployment Wizard is to make sure that the
add-in is enabled:
From the Visual Basic development environment, go to the Add-Ins menu and select the Add-In
Manager menu item.
From the Available Add-Ins list, select Package and Deployment Wizard.
While the Package and Deployment Wizard is selected, click both the Loaded/Unloaded
check boxes and the Load on Startup check box in the lower-right corner of the dialog
Click on the Add-Ins list again, and notice that the Package and Deployment Wizard now
shows up as an item in the menu.
Once the Package and Deployment Wizard is available in the Add-Ins menu, you
are ready to create a setup program for your ActiveX DLL. The wizard simplifies this process
by reading your project in an intelligent manner. It checks for DLL dependencies, references to
other COM components, as well as file dependencies related to any ActiveX controls used in your
project. If your component needs additional files to function properly (such as local databases,
INI files, text files, etc.) and they are not detected by the wizard, you may manually add
them. The Package and Deployment Wizard is best explained through a step by step example:
STEP BY STEP
15.4 Use the Package and Deployment Wizard to
Create a Setup Program
Before you start the Package and Deployment Wizard, you must have already compiled
your DLL. If you choose not to compile, the wizard will direct you to do so. It’s
a good idea to save the project before proceeding. After this has been done, select
the Package and Deployment Wizard from the Add-Ins menu.
Click on the button that is labeled Package (see Figure 15.7).
FIGURE 15.7 The wizard allows you to create setup files for your Visual Basic
project and provides you with means to deploy them.
If you did not save your project before the wizard was started, the wizard
will prompt you with a warning that the source files are newer than the compiled
DLL. You can choose to have the wizard recompile, but if you had just recompiled
this would not be necessary and you could click the No button.
The next dialog box allows you to select the package type. You will be presented
with three choices (see Figure 15.8):
FIGURE 15.8 For an ActiveX DLL, select Standard Setup Package.
• Standard Setup Package
• Internet Package
• Dependency File
Select the Standard Setup Package. The Internet Package is used to distribute
software such as ActiveX controls via the Web. A dependency file is used to document
the file dependencies of your project. This could be necessary if your project
becomes a subproject of another project. For example, your project might be an
ActiveX DLL that will be referenced by another Standard EXE project. In this case,
the EXE depends on your DLL and any subsequent file in the DLL’s dependency
After you have selected the Standard Setup Package item, click on the Next
button to go to the Package Folder screen. Here you will specify the path to the
setup files. Notice that it defaults to the same path as your DLL in a Package
The resulting dialog box asks if you want to create a folder called Package.
The next window shows the Included Files. These are all the files that the
wizard detected as necessary to support your DLL. Notice that you can manually
add more files by clicking the Add button. See Figure 15.9.
FIGURE 15.9 These files will be included on all clients who use the setup
The Cab Options window allows you to select how the setup package will be created.
You have the choice between a Single cab, suitable for a network distribution,
or Multiple cabs, suited for floppy distribution.
Make sure that Single cab is selected and click Next.
The next screen allows you to type in the title that is displayed in the setup
program as it is running. Click Next.
The Start Menu Items window makes it possible for you to have the setup program
add Start Menu items. Since this will be a DLL, it is not necessary to add anything.
The Install Locations window allows you to select the target location of your
program. Click Next.
The wizard will then prompt you to check if your DLL should be installed as
a shared file. Since this is a DLL, it’s probably a good idea to check it
off. Basically, the operating system will keep a usage count of the DLL if it
is a shared file. In other words, if more than one setup program adds that DLL
to the system, the usage count is incremented accordingly. If an application using
the DLL is uninstalled, the operating system will keep the DLL in place if the
usage count has not reached zero.
With your DLL’s check box selected, click Next.
The wizard will create a setup script with corresponding entries for every
setup option you chose. The title of this script is displayed in the Finished
To complete the process, click the Finish button. The wizard will then package
your DLL and all support files into a single CAB file. When it is complete, it
will show you a Packaging Report screen.
Click the Close button on the report screen and then the Close button on the
<< Previous | Content
| Next >>