Freetutes.com

VB6 beginners tutorial - Learn VB6

Advanced VB6 tutorial - Learn Advanced VB6

VB .NET - Learn Visual Basic .NET

Systems Analysis - System analysis and Design tutorial for Software Engineering


You are here: Visual Basic > Advanced VB6 tutorial > Chapter 21

Creating a Standard Setup Package

As explained in "Choosing the Type of Setup Package", a standard setup package provides a setup to the user that enables the user to run a standard Windows SETUP.EXE to install your application.

You begin to create a standard setup package by running the Package and Deployment Wizard. You must choose the Package option on the first screen, and then choose Standard Setup from the second screen (as mentioned in the sections titled "Starting Package and Deployment Wizard and Choosing the Type of Package" and "Choosing the Type of Setup Package").

The following section describe the additional steps that you must take to create your Standard setup package.

After you have selected Standard Setup as the type of package, you will see the Package Folder screen, as shown in Figure 21.4. You can use this screen to choose or create a folder where Package and Deployment Wizard will create your package. The default folder is the folder where the Project’s VBP file resides. It is usually best to create a separate folder so as not to mingle development file with distribution package files.

The Package and Deployment Wizard’s Package Folder dialog box.
FIGURE 21.4 The Package and Deployment Wizard’s Package Folder dialog box.

After you have indicated a folder, you can click the Next button to proceed to the Included Files dialog box, shown in Figure 21.5. Package and Deployment Wizard displays all the files that it could determine were needed in the distribution package. You can use this screen to exclude files from the distribution package: Just uncheck the box next to the filename.

The Package and Deployment Wizard’s Included Files dialog box.
FIGURE 21.5. The Package and Deployment Wizard’s Included Files dialog box.

If you need to include a file that Package and Deployment Wizard didn’t automatically detect, you can click the Add button on the Included Files screen and select the necessary file with the resulting standard File Open dialog box.

After you have selected a file to include in the package, you may see the Missing Dependency Information dialog box shown in Figure 21.6. This screen warns you that Package and Deployment Wizard could not find a dependency (DEP) file for the included file. (See the section titled "Dependency Information in DEP Files" for a further explanation of dependency files.)

Package and Deployment Wizard’s Missing Dependency Information dialog box.
FIGURE 21.6 Package and Deployment Wizard’s Missing Dependency Information dialog box.

If you check the filename on this screen, Package and Deployment Wizard will not bother you again for this file’s dependencies. If you leave the filename unchecked, you should create a dependency file for this file and include the dependency file in the distribution package for this project. (See the section titled "Creating a Dependency File" for instructions on dependency file creation.)

After you have finished including file information, you can click the Next button to proceed to the Cab Options dialog box, shown in Figure 21.7.

Package and Deployment Wizard’s Cab Options dialog box.
FIGURE 21.7 Package and Deployment Wizard’s Cab Options dialog box.

The Cab Options screen enables you to control the number and size of CAB files that Package and Deployment Wizard will make for your application’s distribution package.

Cabinet (CAB) files are now the standard format that Microsoft distribution packages use to compress information.

You can use the dialog box to decide whether to include all the package’s files in a single CAB file or whether to break the information into multiple CAB files. If you decide to use multiple CAB files, you can determine the size of the individual files with the Cab Size dropdown list, as shown in Figure 21.7.

This screen is significant because it enables you to adjust the maximum size of your package’s distribution files in accordance with the type of media that you will use to distribute the application.

Typically, you will choose the Single Cab option whenever you can make the package available to users from a medium that supports very large amounts of storage, such as a network installation or a CD.

If you need to distribute your application to users on media with size restrictions, such as disks, you will choose the Multiple Cabs option and adjust the CAB size appropriately.

After Package and Deployment Wizard has finished and has created your CAB files, you can then deploy them (along with the files SETUP.EXE and SETUP.LST) to the distribution site. If you chose to create multiple CAB files, you can deploy them on disks of the appropriate size. See the following chapter for more information on application deployment.

After you click the Next button to move beyond the Cab Options dialog box, you will see the Installation Title dialog box, shown in Figure 21.8. You can modify the single field on this screen to adjust the title that users will see on the setup screen when they run the setup for your application.

Package and Deployment Wizard’s Installation Title dialog box.
FIGURE 21.8 Package and Deployment Wizard’s Installation Title dialog box.

The next screen after the Installation Title dialog box is the Start Menu Items dialog box, shown in Figure 21.9. This screen enables you to specify whether your application will appear under the Programs section of the Windows Start menu. You can also, of course, determine the exact wording that will appear on the menu item.

Package and Deployment Wizard’s Start Menu Items dialog box.
FIGURE 21.9. Package and Deployment Wizard’s Start Menu Items dialog box.

If your application is a standalone executable, Package and Deployment Wizard will automatically supply an entry on the Start menu items tree. You can remove the item altogether with the Remove button, add a new item or program group with the New Group or New Item buttons, or modify the properties of the current item with the Properties button, as shown in Figure 21.10.

Specifying the properties for your application’s Start menu icon.
FIGURE 21.10 Specifying the properties for your application’s Start menu icon.

Note that Start’s drop-down list contains macros for typical paths on a machine with a Windows install. Because the exact paths and drive letters for these paths can vary from one machine to the next, these macros provide generic tokens that the setup routine will resolve into the correct paths on each user’s system.

The next screen after the Start Menu Items dialog box asks you for the Install Locations of the compiled components of your application, typically just one file (see Figure 21.11).

The Package and Deployment Wizard’s Install Locations dialog box.
FIGURE 21.11 The Package and Deployment Wizard’s Install Locations dialog box.

Once again, the Install Location drop-down list for the file offers a choice of path macros as in the Start menu Properties dialog box just mentioned.

The next screen after the Install Locations screen is the Shared Files dialog box, shown in Figure 21.12. As does the previous screen, this screen also lists the compiled components of your application.

Package and Deployment Wizard’s Shared Files dialog box.
FIGURE 21.12 Package and Deployment Wizard’s Shared Files dialog box.

The purpose of the Install Locations screen is to specify that your component can be shared with other applications on the system. If you mark the application as a Shared file, the system will maintain a reference count on the file. This means that when other applications that use the file are added to the system, the reference count will increase; it also means that when applications that use the file are removed, the reference count will decrease. The file will only be removed from the system if the reference count decreases to zero.

The next screen is the Finished screen, shown in Figure 21.13. When you click the Finish button, the Package and Deployment Wizard builds your package and its support files.

Package and Deployment Wizard’s Finished screen.
FIGURE 21.13 Package and Deployment Wizard’s Finished screen.

After you exit the Finished screen, you will receive a notification screen, the Packaging Report screen (not shown here). This screen informs you of the location of the newly created package. It also informs you of the existence of a batch file (of the form PROJECTNAME.BAT) that you can use to re-create the project’s CAB file or files if you need to change files that make up the package and redeploy it.

If you examine the directory where you had Package and Deployment Wizard create the package, you will note that there are one or more CAB files as well as SETUP.EXE and SETUP.LST. These are the files that must be distributed to users who need to install the application.

Underneath the directory where your package resides, you will find another directory, named Support. The Support folder contains the files necessary to rebuild the package, including the following:

  • The files that are distributed in the CAB file (including SETUP1.EXE, SETUP.EXE, SETUP.LST, and the VB Application Removal utility, ST6UNST.EXE).

  • A batch (BAT) file with the same name as the application. You can use this batch file to run the MakeCab utility to re-create the project’s CAB files. This file might come in handy if you update one of the distribution files (say, your project’s EXE file) and need to re-create the deployment package quickly. You could just copy the new version of the updated file into the Support directory, and then run the batch file and thus update the CAB files.

  • A DDF file with the same name as the application. The DDF file is a text file read by the MakeCab utility to determine how to build the CAB files and also to determine which source files to use.


  

<< Previous | Contents | Next >>

Home | About Us | Privacy Policy | Contact Us

Copyright © Freetutes.com | All Rights Reserved