How to Distribute Your Wizard Using the ADT

Larry W Jordan Jr.
Derik Harris
Microsoft Corporation

Created: July 15, 1996
Revised: August 7, 1996

Larry W Jordan Jr. is a Senior Microsoft Access support engineer.  His main focus is VBA,  wizard and add-in development and Visual SourceSafe integration.

Derik Harris is a Senior Microsoft Access content engineer.  His primary responsibility is writing, editing, and publishing Microsoft Access related material for the Microsoft Knowledge Base and the Microsoft Web site.

Overview

This document describes how to use the Microsoft® Access Developer's Toolkit (ADT) for Window® 95 Setup Wizard to create distribution disks that install an add-in, builder, or wizard along with your custom application. The advantage of this technique is that it saves users from having to run the Add-in Manager utility. The installation of the add-in is simple and automatic.

Introduction

You can install a custom add-in (meaning a custom add-in, wizard, or builder) in two ways: you can use the Add-in Manager utility, or you can use distribution disks created with the ADT. If you want to use the Add-in Manager method, you must include a special table in the add-in file (.mda) called USysRegInfo. The USysRegInfo table must have particular fields and data, which specify the Windows Registry entries that will be created when your add-in is installed. If you want to use the distribution disks (created with the ADT) method, the USysRegInfo table is optional for the add-in file. However, you must provide the same Registry information (stored in the USysRegInfo table) to the ADT Setup Wizard when you create distribution disks.

This document assumes that you are familiar with creating a USysRegInfo table and understand the functionality provided by the Add-in Manager. For more information about the USysRegInfo table and the Add-in Manager, please see the following article in the Microsoft Knowledge Base:

Article ID: Q153858
Title: INF: How to Create a USysRegInfo Table for Installing Add-ins

Running the ADT Setup Wizard

This document also assumes you know how to use the ADT Setup Wizard. All of the illustrations in this document use a sample wizard called the Function Template Wizard, which you can download from the article “The Function Template Wizard.” Any references to the Setup Wizard's interface are limited to the windows (or screens) which pertain to installing an add-in.

Identifying Components

When you run the ADT Setup Wizard to create distribution disks for an add-in, you must first identify the files or components to install. In the screen titled "Add the files that you want your custom Setup program to copy," you must specify the add-in file (.mda) as the main application file. For example:

Figure 1. Add files screen in Setup Wizard

Note that this example lists an optional document file. Also, the Destination Folder is set to $(AppPath), which will cause the add-in to be installed using whatever destination path the user specifies. This is not a problem, because the distribution disks created with the Setup Wizard will still be able to install and register the add-in, regardless of the user-specified destination. This flexibility in the destination path is another advantage over the Add-in Manager, which requires that the add-in file (.mda) be stored in the same folder as the Microsoft Access application file (MsAccess.exe).

Setting Up Shortcuts

Desktop shortcuts for add-ins are usually not necessary, because add-ins are available on the Add-ins submenu (on the Tools menu) in Microsoft Access. However, if you have additional files, such as a document file, you may want to add a shortcut to the document.

Setting Up Registry Entries

The screen titled "Add the Registry values that you want your custom Setup program to create" is an important one for ensuring proper registration of an add-in during installation. The Registry values that you need to specify in the ADT Setup Wizard are the same (or similar to) the ones listed in a USysRegInfo table (used by the Add-in Manager). Therefore, before you run the Setup Wizard, you may want to print a copy of your add-in's USysRegInfo table (assuming it has one). For example:

Subkey Type ValName Value
HKEY_LOCAL_MACHINE\Software\Microsoft\Access\7.0\Menu Add-Ins\&Function Template Builder 0
HKEY_LOCAL_MACHINE\Software\Microsoft\Access\7.0\Menu Add-Ins\&Function Template Builder 1 Expression =startFuncTemplate()
HKEY_LOCAL_MACHINE\Software\Microsoft\Access\7.0\Menu Add-Ins\&Function Template Builder 1 Library |ACCDIR\Function Template Wizard.mda
HKEY_LOCAL_MACHINE\Software\Microsoft\Access\7.0\Menu Add-Ins\&Function Template Builder 1 Description This wizard makes it easy to insert function code templates into your database application.

You can enter the Registry values for your add-in (using the same ones specified in the USysRegInfo table) in the Properties section of the "Add the Registry values" screen. The first value to add is the Expression:

Figure 2. Add value Expression in registry values screen in Setup Wizard

The properties of the Expression value are as follows:

Top Level for Key HKEY_LOCAL_MACHINE
Path to Key Software\Microsoft\Access\7.0\Menu Add-Ins\&Function Template Builder
Value Name Expression
Base Value Data on File (none)
Value Data Type String
Value Data =startFuncTemplate()
Component Name Application

The second value to add is the Description:

Figure 3. Add value Description in registry values screen in Setup Wizard

The properties of the Description value are as follows:

Top Level for Key HKEY_LOCAL_MACHINE
Path to Key Software\Microsoft\Access\7.0\Menu Add-Ins\&Function Template Builder
Value Name Description
Base Value Data on File (none)
Value Data Type String
Value Data This add-in <describe the functionality of the add-in>
Component Name Application

The third value to add is the Library. This setting is important because it results in the creation of the Registry key that your application will use at run time to locate the add-in. In short, it's the actual path to the add-in file (.mda).

Figure 4. Add value Library in registry values screen in Setup Wizard

The properties of the Library in this example are as follows:

Top Level for Key HKEY_LOCAL_MACHINE
Path to Key Software\Microsoft\Access\7.0\Menu Add-Ins\&Function Template Builder
Value Name Library
Base Value Data on File <Select from the list of identified components>
Value Data Type not applicable
Value Data $(FilePath)\<name of the add-in file>
Component Name Application

When you set these properties, you must enter the path and file name of your add-in in the Value Data box. The ADT Setup Wizard can fill in this box for you automatically if you select your add-in from the "Base Value Data on File" box. If you choose to leave the "Base Value Data on File" box blank, you must type the path and file name of your add-in in the Value Data box. To avoid typing errors, it's easier to set the Value Data property by choosing your add-in file from the "Base Value Data on File" box.

When you set the Value Data property, you can use different keywords as an "inherited" destination path. For example:

Option Description
$(AppPath) Folder where your application is installed.
$(WinPath) Folder where Windows is installed.
$(WinSysPath) System subfolder of the Windows program folder.
$(FilePath) Folder where the file you specified is installed.
$(WorkgroupFile) If your custom Setup program installs a Microsoft Access workgroup information (.mdw) file, the folder where the workgroup information file is installed.

Finishing the Setup Wizard

You can proceed through the rest of the wizard and set the remaining self-explanatory options. Note that an add-in does not require additional utilities, such as the run-time or workgroup administrator; however, you can include these options if you want.

Conclusion

Using the ADT Setup Wizard to create disks for installing and registering an add-in has two advantages. First, it ensures that the add-in is registered correctly, regardless of the user-selected destination path. Second, it provides users with a simple, automatic way of installing an add-in.