Using the Package and Deployment Wizard to Package Microsoft Access Run-Time Solutions

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

 

Mark Prentice
Microsoft Corporation

January 1999

For the latest information, see http://msdn.microsoft.com/office/default.asp.

This paper covers what the Visual Basic® for Applications (VBA) Package and Deployment wizard can and cannot do when packaging Access run-time solutions on Windows® 95/Windows 98 and Windows 2000. Specifically, it covers locating the Package and Deployment wizard, adding the Access run time to a package, using default Start menu shortcuts, creating new shortcuts, adding registry settings, and expected deployment behavior.

The Package and Deployment wizard is a wizard-driven application used to distribute Microsoft Office 2000 Developer solutions. This wizard replaces the Setup wizard from the Microsoft Office 97 Developer's Toolkit.

The Package and Deployment wizard is based on the same technology as the Visual Basic Package and Deployment wizard. The VBA Package and Deployment wizard identifies project dependencies needed for the deployed application to be started from the VBA environment. Because of this change from the Office 97 Setup Wizard, shortcuts can no longer be placed on the Windows Start menu as they were in Office 97.

Getting to the Package and Deployment Wizard

The Package and Deployment wizard for VBA projects is loaded as a VBA add-in.

To load the wizard, follow these steps.

  1. Open your Access solution's VBA project by viewing one of the Code modules.
  2. From the Add-ins menu, select the Add-in Manager.
  3. Double-click the Package and Deployment Wizard to load it, then click OK.
  4. From the Add-ins menu, select Package and Deployment Wizard to launch the wizard.

Adding the Access Run Time to the Package

Once the Package and Deployment wizard has started, click the Package button and then the Standard Package button to create a new package.

After moving through a few screens, making a few decisions on where to store your package, a screen titled Include Files appears. This page contains the option to add the Access run time to your solution.

To include the Access run time, select the Include Access Runtime box.

NoteIf you have not copied the Access run-time files from the Office 2000 Developer CD, you will get a message asking you to copy the Access run time from the CD to the ..\Microsoft Office\ODETools\V9\Runtime folder on your machine. If you do not want to store a copy of the Access run time on your machine, you can simply point to the install.msi on the CD. This can be found on your CD in the \ODETools\V9\AccessRT folder.

Once the Access run time is copied to the Runtime folder, the Package and Deployment wizard will not prompt you again for the Access run time location.

Using the Default Start Menu Items

The Microsoft Office 97 Developer Edition Setup Wizard contains options with which you can define shortcut properties. These options write the correct command line switches to start Access in the run-time mode, to use a Workgroup file, or to use a profile. These options are not available in the Package and Deployment Wizard. You can manually add existing shortcuts and create new shortcuts, including the Access command line, switches to accomplish the same functionality as the option buttons in the Setup Wizard.

The Package and Deployment wizard creates a default Start menu shortcut with a target under the properties of "$(AppPath)\YourApp.mdb". When Setup is run, the package creates a shortcut, including the path to msaccess.exe for any Access file. Then the Package and Deployment wizard's macro $(AppPath) points to the application directory and adds YourApp.mdb.

All Package and Deployment macros will work here. Some of these macros include $(WinSysPath), $(WinPath), $(Program Files), and others.

If you want to add any of the Access command line switches, you need to do it here in conjunction with the macros. An example would be using the run-time and workgroup switches. To use these switches, type in the Start menu property:

"$(AppPath)\MyApp.mdb" /Runtime /wrkgrp "$(AppPath)\MyWrkgrp.mdw".

Note 

  

Any paths containing long file names need to be enclosed in quotation marks.

Creating New Start Menu Items

To create more than one Start menu shortcut, simply add a new item on the Start Menu Items screen by clicking the Add Item button. This creates a new shortcut pointing to your Access project.

From here you can create a shortcut using any of the Access command line switches and any of the Package and Deployment wizard macros. See "Using the Default Start Menu Items" for more information.

An example for creating a shortcut that compacts the database would be:

"$(AppPath)\MyApp.mdb" /compact 

Adding Registry Settings

The package created with the Package and Deployment wizard registers registry files automatically. If you add a registry file to the list of components, the package automatically registers these files at the end of setup.

To create a registry file, run regedit.exe from the Run command. Navigate through the keys to locate the regkey where you want to create your custom registry. Create the needed keys, then save those keys as a registry file by selecting Export Registry from the Registry menu.

NoteThis process will only create static registry keys. There is no way to create a key that points to a custom installation location. Therefore, there is no way to deploy an Access wizard and have it registered during setup. You will have to use the Add-in Manager to add your wizard to the Access environment. Check http://support.microsoft.com/support/ or http://www.microsoft.com/office/default.asp for updates on this issue.

Expected Deployment Behavior

The Package and Deployment wizard package uses Visual Basic components to run Setup. If these files are not on your computer, Setup copies them and then restarts the computer. These files will not be installed on a clean computer. After this restart, the user must rerun Setup.

Setup then determines whether Access 2000 is on the system. If it is not, the user is prompted to install it before continuing. The user is then prompted to select a Typical or Custom setup. The Typical option installs the Access run time to the default directory. The Custom option prompts for a different installation location.

NoteThere is no way to stop the user from selecting the Custom setup option.

After Access run time has been installed, the computer restarts and then continues with Setup. At this time, the user is prompted for the installation location for the Access database and any other included files.

If there is no other file to be executed at the end of Setup, Setup will finish.

Issues When Using the Package and Deployment Wizard to Create Access Run-Time Applications

Large Distribution Sets

Distribution sets created with the Package and Deployment wizard that include the Access run time will be greater than 160 megabytes.

Internet Explorer 5.0

Microsoft Access 2000 relies upon technology available in Microsoft Internet Explorer 5.0. For instance, in order to distribute and use data pages, the workstation must have Internet Explorer 5.0 or later. Internet Explorer 5.0 will not become the default browser unless a previous version of Internet Explorer was present on the workstation.

Multiple Restarts on Target Machines

If a user installs an application created by the Package and Deployment wizard that contains the Access 2000 run-time files and the workstation does not have Internet Explorer 5.0 or Office 2000 already installed, the computer will be restarted two times during the installation process.