Package and Deployment Wizard’s automated process will generate a fully
usable, professional setup that you can distribute to users or to Internet developers.
Sometimes, however, you will need to go beyond Package and Deployment Wizard’s
end products and alter the standard setup that it creates.
You might need to customize Package and Deployment Wizard’s product in
situations such as the following:
SETUP.LST and Your Application’s DEP File
Customizing the Standard
VB Setup Project
Implementing Application Removal
Customizing SETUP.LST and Your Application’s DEP
You can modify the information about files that you need to distribute with
your application’s setup by editing SETUP.LST and your application’s
DEP file. By editing SETUP.LST and the DEP file, you can avoid having to rerun
Package and Deployment Wizard for minor changes in your application’s setup
Suppose, for example, that your application no longer uses a particular custom
control, say DBGrid (you have removed all functionality of DBGrid from your application).
Instead of rerunning Package and Deployment Wizard just to create a new setup
that lacks DBGrid, you could edit the copy of SETUP.LST on your master distribution
media. You would just open SETUP.LST in Notepad or another text editor and search
for the line in SETUP.LST that refers to DBGrid.OCX. You could remove the line,
and then save and exit the file. Then, you could go to the DEP file for your application
and remove the reference there for DBGrid.
Customizing the Standard VB Setup Project
You can modify the setup routine for your application by locating and editing
its VB source code. Recall that Package and Deployment Wizard provides the setup
program (SETUP1.EXE) for your application.
FIGURE 21.17 You can customize an application’s setup routine by opening
and modifying SETUP1.VBP. The designer for frmSetup1 is shown here.
Setup1 is a VB application known as the "Setup Toolkit project,"
and its VB project exists under your VB directory in the path \Wizards\Package
and Deployment Wizard\Setup1\SETUP1.VBP. If you want to customize the Setup1 project
(known as the "Setup Toolkit project"), you should save the customized
version in a separate directory so that future sessions of Package and Deployment
Wizard won’t use it for all applications. The Setup Toolkit project contains
many files, but the main focus of your customization efforts will probably be
the Load event of the Setup1 project’s main form, frmSetup1 (see Figure
Implementing Application Removal
Setup1 creates a log file (ST6UNST.LOG) in the application directory containing
information about the modifications that it makes to the system (such as files
copied and Windows Registry entries). Setup1 also furnishes a VB6 application
removal utility, ST6UNST.EXE.
The application appears on the Add/Remove facility of the Control Panel. If
the user calls Add/Remove to remove the application, the system uses ST6UNST.EXE,
which reads the log file and undoes the work of the setup.
Application removal can fail under the following circumstances:
If the user or another application copies, moves, or removes application files
and directories manually.
The application setup log is removed from the application directory.
The user installs the application more than once to more than one directory.
NOTE - The Relationship Between SETUP.EXE and Customized
Setup Routines: For an explanation of the relationship between Microsoft’s
SETUP.EXE and your customized setup routine, see the section in this chapter titled
"SETUP.EXE and Package and Deployment Wizard’s