3 4
When you create an Access application, you may want to install it on computers where Access is not installed. If you have the Microsoft Office Developer (MOD) edition of Office XP, you can use one of its components to prepare a set of files to distribute to the individuals who will be using your database, including a run-time version of Access, which lets Access databases be installed and run by users who don’t have the full version of Access.
The Packaging Wizard component of the Microsoft Office Developer (MOD) edition of Office XP allows you to prepare a package of all the files that your application needs, making it easy to distribute the application to users. When you need to distribute an Access application to individuals who don’t have Access, you can include a run-time version of Access in your distribution package so that users can run the application even if they don’t have Access installed.
While the run-time feature is the main reason to use the Packaging Wizard, you may also want to prepare a package of files to distribute to users (even those who have Access installed), in order to guarantee that they have the correct versions of any ActiveX controls you use in the application. Because the lack of an ActiveX control on a user’s computer (or the wrong version of the control) can cause cryptic errors in an application, preparing a distribution package is a good idea if you use any ActiveX controls in your application.
See "Working with ActiveX Controls" for more information on ActiveX controls.
The Packaging Wizard doesn’t create a single executable file the way Visual Basic does. Instead, it creates a set (perhaps quite a large set) of CAB files, which you can distribute to users on a CD or over a network. The distribution package includes a Setup program (similar to the one used by many Microsoft programs) that makes it easy for users to install the application. In this appendix, you’ll learn how to prepare a set of distribution files to distribute to users, so that they can install and use your application, with all the components the application needs to run properly.
note
When you install the MOD edition of Office XP, the Packaging Wizard is installed by default, although you can deselect the Packaging Wizard while installing MOD. To check whether this MOD component has been installed, open the VBE window in an Access 2002 database by pressing Alt+F11, and then choosing Add-Ins, Add-In Manager. If the Packaging Wizard appears in the list of available add-ins, as shown in Figure B-1, it is installed and ready to use.
Figure B-1. Check for the Packaging Wizard in the Add-In Manager.
If you don’t see any add-ins listed, MOD has probably not been installed. If other add-ins are listed but the Packaging Wizard is not, MOD might have been installed with the Packaging Wizard component deselected.
In either case, in order to install (or reinstall) MOD with the Packaging Wizard component, follow these steps:
Figure B-2. The Office XP Developer Setup screen looks like this.
Next, a Restart Windows message box appears. Depending on which components need to be installed on your system, you might have to restart Windows several times. After the last restart, you will see the Congratulations screen.
The Install screen appears next, with a progress bar indicating installation progress. After a final restart, MOD is installed, and you are ready to use the Packaging Wizard and other components.
To demonstrate the Packaging Wizard, this section includes a small sample application, Address Book 2002, with several forms that use special ActiveX controls: the CommonDialog control, the Calendar control, and the DateTimePicker control. When you run the Packaging Wizard, it analyzes the application and gathers together all the files needed to support these special controls, along with the standard Access support files.
To prepare a set of distribution files for an Access application, follow these steps (using Address Book 2002 as an example):
caution
Figure B-3. The Add-In Manager dialog box helps determine which MOD components are loaded on startup.
You can set the Load behavior separately for each component, and also determine whether that component is loaded on startup.
tip
Figure B-4. This page of the Packaging Wizard allows you to identify the application you want to package and select the package to build for it.
Figure B-5. Enter the relevant package information on the Application Information page.
Figure B-6. The Dependencies screen of the Packaging Wizard allows you to choose files and modules for the application.
caution
To add an icon for the application, click Add File to open a standard File Open dialog box to select the icon. The new icon will appear at the bottom of the Dependencies screen. Click Next.
Figure B-7. Generally, you should leave the suggested locations for components as is.
Table B-1 lists the available choices.
Table B-1. Standard install locations for the Packaging Wizard
Installation location options | Example |
$(AppPath) | C:\Program Files\ApplicationName |
$(WinPath) | C:\Windows |
$(WinSysPath) | C:\Windows\System |
$(WinSysPathSysFile) | C:\Windows\System32 |
$(CommonFiles) | C:\Program Files\Common Files |
$(CommonFilesSys) | C:\Program Files\Common Files\System |
$(ProgramFiles) | C:\Program Files |
$(MSDAOPath) | C:\Program Files\Common Files\Microsoft Shared\DAO |
$(Font) | C:\Windows\Fonts |
tip
Figure B-8. The Define Start Menu Shortcuts screen of the Packaging Wizard allows you to create a shortcut to your application.
A new shortcut appears in the program group.
Figure B-9. You can create a shortcut to compact the database.
You can also select an icon for the shortcut, if one was included in the package of files.
tip
After clicking the OK button on the properties sheet, the new shortcut is now listed as Compact Database. Click Next.
Figure B-10. The Run On Complete screen of the Packaging Wizard allows you to specify a command to run at the end of installation.
If you choose to save the package script without building, the wizard will close when you click Finish. You can run the wizard again later, select the saved script, and generate the set of distribution files.
If you choose to build the setup program, when you click Finish, the Browse For Folder dialog box appears. Select (or create) the folder to hold the package files. The default folder is called Package; it’s located under the folder containing the application database. Click OK.
The first time you run the wizard, you will get the message shown in Figure B-11. This message appears when there is no disk image of standard Access components to use when preparing distribution packages.
Figure B-11. The Packaging Wizard displays this message if it can’t find the standard Access components.
The files are copied from the CD to the new folder, without any progress bar or dialog box. However, you can see the lights flickering on your CD drive and computer hard drive during the copying process. When all the files are copied, the Create Package screen appears again, and the progress bar will start moving.
The package will be created. When it is done, the Package Complete! screen appears.
To distribute the packaged files, copy them to a CD. When the user inserts the CD, the Setup program will start automatically.
note