Microsoft KB Archive/320151

From BetaArchive Wiki

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

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 "References" section of this article.

back to the top

Sample program to use with Dependency Walker

  1. Paste the following code in a program (.prg) file, and then run the program from the Command window.

    LOCAL cMain
    
    SET SAFETY OFF
    
    cMain = "WAIT WINDOW 'Press Any Key To Exit'"
    
     * Save the string cMain to Main.Prg.
    STRTOFILE(cMain, "Main.Prg")
    
    CREATE PROJECT DependSample NOWAIT
    _VFP.ActiveProject.Files.Add("Main.Prg")
    
    * Compile the project into an executable.
    _VFP.ActiveProject.Build("DependSample.Exe",3,.T., .T.)
                        
  2. This creates DependSample.exe, which is used later in this article.

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 "Sample Program to Use with Dependency Walker" 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:
    • Kernel32.dll
    • User32.dll
    • Advapi32.dll
  5. 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.
  6. 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.
  7. 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:
    • Msvcr70.dll
    • Vfp7r.dll
    • 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.

  1. Start InstallShield Express and create a new project, or open an existing project.
  2. 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.
  3. 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.
  4. 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:
    1. Under Specify Application Data, click Files.
    2. In the Source computer's folders pane and the Source computer's files pane, locate the files that you have to include.
    3. Drag the files to the folder in Destination Computer in the Destination computer's folders pane where you want the files installed.
  5. If you install files that have to be registered, you can have InstallShield register these files for you. To do this follow these steps:
    1. In Destination Computer in the Destination computer's folders pane, find the file that has to be registered.
    2. Right-click the file in the Destination computer's files pane, and then click Properties.
    3. Click the Advanced tab, and then in the Registration Type list, click Self-registration. Click OK.
    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.
  6. Build and distribute your setup as you normally would.

back to the top

REFERENCES

The following files are available for download from the Microsoft Download Center:
[GRAPHIC: Download]Download the Dependsia64version2.1.3623.exe package now. Release Date: June 25, 2002

For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to obtain Microsoft support files from online services


Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file. back to the top


Additional query words: depends.exe

Keywords: kbhowtomaster kbdownload kbcodesnippet kbfile kbappsetup kbsetup kbsample KB320151