Preparation for Distributing Applications

This section describes a number of issues you should consider when preparing your application for deployment.

  • Build Type Selection
  • Hardware, Memory, and Network Issues
  • Ensuring Correct Run-Time Behavior
  • Default Menu Options

Build Type Selection

Before you can distribute your application, you must build an application (.app) file, an executable (.exe) file, or a COM component (automation server) with a .dll or .exe extension. When choosing the type of build you want to create, consider the size of your final application file and whether users have Visual FoxPro installed on their computers.

The following table lists the differences between the types of builds.

Build type Description
Application (.app) file This file requires that the user have a copy of Visual FoxPro installed. An .app file is usually smaller than an .exe file.
Executable (.exe) file This file includes the Visual FoxPro loader so users do not need have Visual FoxPro installed.

You must provide the two support files Vfp8r.dll and Vfp8renu.dll. The letters, "en", denote the English version. These files must be placed in the same directory as the .exe file or along the DOS path. See BUILD EXE Command for details about creating and distributing executable files.

COM Server (.dll or .exe) files This file is used to create a file that can be called by other applications.

In Visual FoxPro, you can create two types of COM server (.dll, formerly, OLE) files. You must provide run-time support files, including the Vfp8r.dll, Vfp8t.dll, and Vfp8renu.dll files. For details, see Adding OLE Objects to Applications.

Hardware, Memory, and Network Issues

You should consider and test the minimum environment your application can operate in, including the amount of disk space and memory. The results of your testing and the resolution of other issues covered in this section can help determine the type of build you choose and the files you include with your application.

The applications you create have the same hardware, memory, and network requirements as Visual FoxPro. For more information on those requirements, see "System Requirements" in Installing Visual FoxPro. For additional information on creating applications for multiuser environments, see Programming for Shared Access.

Ensuring Correct Run-Time Behavior

An executable application (.exe) file always checks for the presence of the Visual FoxPro run-time library, Vfp8r.dll. In some cases, Visual FoxPro in-process servers, or .dll files, can use the lightweight Vfp8t.dll run time instead. For more information about run-time libraries, see VFP8R.DLL Run-Time Library and VFP8T.DLL Run-Time Library.

To run an application .exe file using the development version of Visual FoxPro, you must force the application to use the Visual FoxPro Vfp8.exe file instead.

To run an executable application in Visual FoxPro

  • From the Project menu, choose Do. In the Do dialog box, select the name of your application's .exe file.

An application consisting only of modeless forms will not function properly in a run-time environment unless you provide a READ EVENTS command. You can make sure the application runs properly by adding a calling program or setting the WindowType property.

You can also type DO followed by the name of your application's .exe file in the Command window or use the -E command-line switch in the command line that starts Visual FoxPro. For example, if your application is called MYAPP, you can run it with the following command line:

MYAPP.EXE -E

This command-line switch forces the application to use the executable file, Vfp8.exe. For this switch to work correctly, Vfp8.exe must be in the search path.

To run a form in a run-time environment

  • Run the form from a program containing a READ EVENTS command.

    -or-

  • Set the form's WindowType property to Modal.

Some Visual FoxPro applications rely heavily on Visual FoxPro system menus. At run time, some menus and commands are unavailable, and without a provision for a READ EVENTS command, a menu-driven application ends as quickly as it starts. Use the following section to review any menus you include in your application.

For more information on structuring an application with the READ EVENTS command, see Controlling the Event Loop and examples of how to structure an application in Compiling an Application.

Default Menu Options

If you use the Visual FoxPro system menu, your application file includes only the following default menus and menu commands.

Menu Menu items
File Close, Save, Save As, Exit
Edit Undo, Redo, Cut, Copy, Paste, Paste Special, Select All, Find, Replace
Window Arrange All, Hide, Hide All, Show All, Clear, Cycle, all open windows
Help Contents, Search for Help on, Product Support, About Visual FoxPro

You can disable or remove any of the default menus and menu commands, or add your own menus and menu commands to run-time applications.

Tip   If your menu system works in the development environment but closes prematurely in your application, make sure you have a READ EVENTS command active while your menu system is running. Also be sure to include a CLEAR EVENTS command when you exit the menu system.

For more information about customizing menus, see Designing Menus and Toolbars.

See Also

Distributing Applications | Application Distribution Process | Resource Files in Applications | Distributable and Restricted Visual FoxPro Features and Files | Including Files with Applications for Distribution