The Package and Deployment Wizard

The Package and Deployment Wizard does a lot of work for you, including the following tasks:

  • Compiles the application and compresses the files.
  • Creates a setup program that can be used to install the application.
  • Determines the best fit for installation floppy disks, creates the numerous setup disks, and splits extra large files across multiple floppy disks. The Package and Deployment Wizard tells you in advance how many floppy disks the setup requires.
  • Copies your compiled application to a hard disk so that you can install the application over a network or onto a CD-ROM creator.
  • Sets up your application for distribution across the Internet for Internet Explorer users.

The Package and Deployment Wizard generates a list of several files needed for the setup. A single Setup.exe file doesn't come out of the setup routine. Often, a Visual Basic application requires DLL and OCX files, and those files must reside in the targeted setup area (floppy disks or a hard disk) with the compiled program and the Setup.exe program.

Before you can run the Package and Deployment Wizard, you must load your application's project. After you've debugged and compiled your project, you're ready to create the installation module. The as part of the installation routine, the Package and Deployment Wizard, will compile your code one final time just in case you've made an edit since your most recent compilation.

The Package and Deployment Wizard isn't part of Visual Basic's development environment. You need to select the Package and Deployment Wizard from the Add-Ins|Add-In Manager. This loads the Package and Deployment Wizard to the Add-Ins menu, where you can start the wizard. Figure 21.12 shows the opening window for the Package and Deployment Wizard.

Figure 21.12

The Package and Deployment Wizard prepares your application for distribution.

The first Package and Deployment Wizard option (which is the option you'll probably select most of the time) creates a standard Setup.exe routine that your users can install. The Package and Deployment Wizard can prepare this installation routine on a hard disk, floppy disks, CD-ROM writer, or in special CAB files that you can send out over the Internet for online distribution. The second option sends the installation routine to an Internet server that can install the application remotely. During the installation creation routine, the Package and Deployment Wizard creates a script file that describes the setup routine. In subsequent sessions, you can either modify a setup script that you've already created, or you can create the setup from the original project. The third option on the Package and Deployment Wizard's opening window lets you manage your installation scripts.

The first option generates the most common forms of an installation routine for most applications. After you click the first option, you'll see the window shown in Figure 21.13. Unless your application requires external ActiveX controls or database files, you can keep the first option selected.

Figure 21.13

Determining the kind of setup package to create.

tip

If you want to set up an ActiveX control, be sure to select the Dependency File option so that the wizard can collect the proper files in the order the application needs them.

Click Next to show the Build Folder dialog box, which requests distribution information. The Package and Deployment Wizard needs to know where your final setup application should go. The directory you select should be empty. Therefore, when the wizard finishes, you'll know that all the files in that directory are there as the result of the wizard. When you click Next, the wizard scans your project file to determine which program files your application needs. The wizard can't determine which database drivers are needed if your application contains any data-related controls. You'll see the dialog box shown in Figure 21.14 if your application requires database access. Copy the application's required database driver to the left window.

Figure 21.14

You may have to select the data access files manually if your application requires data access.

caution

Your dialog box may differ depending on the type of data access (ADO, DAO, and so on) your application uses.

After clicking Next, you might see the DAO ODBC Access dialog box if your application requires ODBC support. If so, you'll have to specify the kind of ODBC your application requires. If you didn't use a database with ODBC access, you won't need to worry with this dialog box.

When you click Next again, the wizard collects all the application's files you've specified and displays the dialog box shown in Figure 21.15. Make sure you look through the files to determine that every file is listed that your application requires. You might need to add (by clicking Add) more files, such as Readme.txt or a database file. Additional database support files might be needed. If so, you need to add those database files to the file list so that the installation routine stores these database files along with the installation files in the setup package.

Figure 21.15

Looking through the files to make sure the Package and Deployment Wizard collected all the files your project needs.

tip

Do make sure you have proper access to any ActiveX control you distribute with your application. You might not always have the proper license authority to distribute ActiveX controls, unless you created those controls yourself. Therefore, consult your ActiveX control vendor to learn the rules under which you can distribute the controls.

The Package and Deployment Wizard's next dialog box requests distribution information. You can create a single distribution file, or you can request that the setup routine be placed across multiple floppy disks or other kinds of media. After you determine how you want the Package and Deployment Wizard to divide your installation routine, click Next to display the Installation Title screen. Here, you'll type your installation project's title and then click Next to move to the Icons dialog box.

From the Icons dialog box, you create the submenu that will appear on the PC's Start menu. By clicking the New button and displaying the Add Group dialog box shown in Figure 21.16, you can add submenu items to the Start menu's entry for this application. The submenu items might include a Readme file or an auxiliary program (such as a system utility). By clicking the New Icon button, you can specify the icon that will appear on each menu option.

Figure 21.16

You can determine the way the application will appear on the end-user's Start menu.

The next screen you see, called the Install Locations screen, determines the locations of each of the installed files. Although you'll want the majority of the files installed in the folder that the user selects during the installation procedure, as specified by the system variable AppPath, you can select individual files in the Package and Deployment Wizard's list and send those files to an alternate folder, such as the user's Program Files folder (specified by the system variable ProgramFiles).

note

As you can see, the Package and Deployment Wizard requires numerous decisions. With those decisions, however, comes complete control over how and where your application arrives on the user's system.

Click Next to select any files you want to designate as shared files. A file may be shared not only by other users (as would be the case for a database file the application might access) but also by other programs on the computer, as might be the case with ActiveX controls your project contains. Designate which files are shared by clicking next to each shared file (that is, by placing a check mark in the box next to that file).

After clicking Next, you'll see the final Package and Deployment Wizard screen, which asks what you want to call this installation's script file. By creating a script file, you won't have to answer the long list of wizard queries you've had to answer to this point the next time you create the installation routine. In addition, you can modify the script without having to redo the installation screens if something changes in the installation process, such as the removal of a shared file.

When you click Finish, the Package and Deployment Wizard will build the installation script, create the installation routine, and place that routine in one or several files, depending on the options you selected. When this is finished, a setup file (or files) will reside on your PC that you can distribute to install and re-create your application on other computers.

Top Home