Visual Basic Concepts
In addition to using the Setup Toolkit project to create your own custom setup project, you can use the Setup Toolkit project in conjunction with the Package and Deployment Wizard. In this case, you use the Setup Toolkit project to customize the screens or other parts of the installation sequence, then use the wizard to create and deploy the package for the application.
For example, you might use the Setup Toolkit and the Package and Deployment Wizard together to add dialog boxes to the installation program, prompting the user to specify whether to install optional features in your application. For example, you may have an online Help file that some users would rather not install. You can add as many installation options as you want.
To add an installation option to your setup program
The following shows an example of how you would add a dialog box that asks if the user wants to install optional files:
Dim LoadHelp As Integer
LoadHelp = MsgBox ("Do you want to install Help? ", vbYesNo)
If LoadHelp = vbYes Then
CalcDiskSpace "Help"
EndIf
' Block of code containing cIcons = CountIcons(strINI FILES)
If LoadHelp = vbYes Then
cIcons = CountIcons("Help")
EndIf
' Block of code containing CopySection strINI_FILES.
If LoadHelp = vbYes Then
CopySection "Help"
EndIf
' Block of code containing CreateIcons, strINI FILES, strGroupName
[Help]
File1=MyApp.HL1,MyApp.HLP,$(AppPath),,,10/12/96,2946967,0.0.0
When the user runs the installation program for the example shown in this procedure, the setup program copies all the BootStrap files to the user's machine and then prompts the user to indicate whether to install the Help files. If the user chooses Yes, the CalcDiskSpace statement determines whether there is sufficient disk space on the user's machine for the Help files. The program then installs all of the files listed with the Setup1 Files section in Setup.lst.
Next, the program tests the LoadHelp flag again. If the user chose to install the Help files, Setup1.exe next executes the CopySection statement for the Help files, and installs the files listed in the [Help] section of Setup.lst.
For More Information See "The Package and Deployment Wizard" earlier in this chapter for more information on features of the wizard.