Microsoft KB Archive/320151

= How to determine dependencies with InstallShield Express =

Article ID: 320151

Article Last Modified on 3/4/2005

-

APPLIES TO


 * Microsoft Visual FoxPro 7.0 Professional Edition
 * Microsoft Visual FoxPro 8.0 Professional Edition

-



This article was previously published under Q320151



IN THIS TASK

 * SUMMARY
 * Sample program to use with Dependency Walker
 * Check Your application for dependencies
 * Include dependencies in InstallShield
 * REFERENCES



SUMMARY
InstallShield Express - Visual FoxPro Limited Edition is included with Visual FoxPro 7.0 and later versions of Visual FoxPro. With this version you cannot determine the dependencies of a Visual FoxPro application. This article discusses how to use the Dependency Walker tool to determine the dependencies for a sample Visual FoxPro application, and how to incorporate them into an InstallShield project. For more information about how to install Dependency Walker, see the &quot;References&quot; section of this article.

back to the top

Sample program to use with Dependency Walker
  Paste the following code in a program (.prg) file, and then run the program from the Command window. LOCAL cMain

SET SAFETY OFF

cMain = &quot;WAIT WINDOW 'Press Any Key To Exit'&quot;

* Save the string cMain to Main.Prg. STRTOFILE(cMain, &quot;Main.Prg&quot;)

CREATE PROJECT DependSample NOWAIT _VFP.ActiveProject.Files.Add(&quot;Main.Prg&quot;)

_VFP.ActiveProject.Build(&quot;DependSample.Exe&quot;,3,.T., .T.)  This creates DependSample.exe, which is used later in this article.
 * Compile the project into an executable.

back to the top

Check your application for dependencies

 * 1) Start Dependency Walker. For additional information about how to use this program, see Help in Dependency Walker.
 * 2) On the File menu, click Open, or press CTRL+0.
 * 3) Find DependSample.exe that you created in the &quot;Sample Program to Use with Dependency Walker&quot; section, and then click Open.
 * 4) On the Profile menu, click Start Profiling. The Profile Module dialog box appears. Accept the default options, and then click OK. When the Wait Window appears, press any key to quit the application and return to Dependency Walker. The Module Dependency Tree View contains a list of files that the sample application depends on. Some of the files listed here are system files and should not be distributed with your application. The following are examples of system files:
 * 5) * Kernel32.dll
 * 6) * User32.dll
 * 7) * Advapi32.dll
 * 8) All of the files may not be listed as parent items in the tree. Expand the dependencies that are not system files to make sure that you include any files that have dependencies to the main files.
 * 9) If DependSample.exe is built under VFP 7.0, you see Msvcr70.dll. Because Msvcr70.dll is not a system file, include it. If you expand Msvcr70.dll, you see Kernel32.dll. Kernel32.dll is a system file. Therefore, it does not have to be included. Also note that the Vfp7r.dll file is in the list. This is one of the FoxPro runtime DLLs. If you expand Vfp7r.dll, you see several files that are system files. The Vfp7renu.dll file is not a system file. If DependSample.exe is built under VFP 8.0, the FoxPro runtime DLLs are Vfp8r.dll, Vfp8renu.dll, and GDIPlus.dll. If DependSample.exe is built under VFP 9.0, you see Msvcr71.dll. The FoxPro runtime files for a VFP 9.0 executable are Vfp9r.dll, Vfp9renu.dll, and GDIPlus.dll.
 * 10) To help to determine which files are system files and which files are not, right-click the file in question, and then click Properties. The Properties dialog box appears. Click the Version tab, and then view the Product Name. The files that are system files may say Microsoft Windows Operating System, or something similar. A Visual FoxPro 7.0 application has dependencies on the following three files:
 * 11) * Msvcr70.dll
 * 12) * Vfp7r.dll
 * 13) * Vfp7renu.dll

back to the top

Include dependencies in InstallShield
This section discusses how to include those files that were determined to have dependencies in an InstallShield setup.  Start InstallShield Express and create a new project, or open an existing project. To incude files in InstallShield click either Files or click Objects/Merge Modules under Specify Application Data. In InstallShield 5.0 that is included with VFP 9.0, Redistributables replaces Objects/Merge Modules.

Note In this example, use Objects/Merge Modules because there are merge modules for both Msvcr70.dll (VFP 7.0 and 8.0) or Msvcr71.dll (VFP 9.0) and the Visual FoxPro Runtime DLLs. Click Objects/Merge Modules, and then click Microsoft Visual C++ 7 Runtime Library (MSVCR70.msm), and Microsoft Visual FoxPro 7 Runtime Libraries (Vfp7Runtime.msm) from the Objects/Merge Modules list. For Visual FoxPro 8.0, click Microsoft Visual FoxPro 8 Runtime Libraries (Vfp8Runtime.msm) and Microsoft Visual C++ 7.0 Runtime (MSVCR70.msm) under the Redistributables. For Visual FoxPro 9.0, click Microsoft Visual FoxPro 9 Runtime Libraries (Vfp9Runtime.msm). For Visual FoxPro 9.0, click Microsoft C Runtime Library 7.1 (VC_User_CRT71_RTL_X86_---.msm) under the Redistributables list in Step 2 of InstallShield 5.0.

Note When you select Microsoft Visual FoxPro 8 Runtime Libraries or Microsoft Visual FoxPro 9 Runtime Libraries GDI Plus Redist Module is automatically selected. This places GDI Plus on the target machine. Both VFP 8.0 and 9.0 executables require GDI Plus. If you do not have a merge module for files that have to be included, you can add them. To do this, follow these steps:  Under Specify Application Data, click Files.</li> In the Source computer's folders pane and the Source computer's files pane, locate the files that you have to include.</li> Drag the files to the folder in Destination Computer in the Destination computer's folders pane where you want the files installed.</li></ol> </li> If you install files that have to be registered, you can have InstallShield register these files for you. To do this follow these steps:  In Destination Computer in the Destination computer's folders pane, find the file that has to be registered.</li> Right-click the file in the Destination computer's files pane, and then click Properties.</li> Click the Advanced tab, and then in the Registration Type list, click Self-registration. Click OK.</li></ol>

This registers the file for you when it is installed. Note that some files do not have to be or cannot be registered, and the Self-registration selection will not be available.</li> Build and distribute your setup as you normally would.</li></ol>

back to the top

<div class="references_section">