Adding the VFP runtime libraries and other dependencies


(Example: VFP8 R UNTIMES . ISS )

After you create a script using the script wizard, you may find you want to make modifications or additions before compiling and shipping the setup to your users. To add a file entry or any other entry to your script, or to change or delete an existing entry, simply edit the script in Inno Setup or another text editor. The nice thing about working with a script file is that the existing script is all there in the edit window, so you can easily refer to the syntax of existing entries as you work and use it as a template for your new entries.

Regardless of anything else you may want to do to your script before you compile it, you will almost certainly want to add the VFP Runtime Libraries and other dependencies such as ActiveX controls. For several reasons the script entries for these files are a bit different than those for the other files that comprise your application: the runtime support files do not get installed to the same directory as your application, they do not change much (if at all) from one application to another, and some of them need to be registered. A convenient way to handle these script entries is to create them once and store them in a separate file you can copy and paste into your scripts when needed.

The additional files required for the DeployFox Demo App are the VFP8 Runtime Libraries and the MSCOMCTL.OCX ActiveX control file. Listing 2 shows the script entries needed for these files. Note that most of these entries belong in the Files section of the script, but one belongs in the Run section. The section headers in Listing 2 are there only to remind you which entries go in which sections. The script generated by the script wizard already has these section headers in it, so don ‚ t insert them again; just copy and paste the entries themselves into the corresponding section of your script.

On The Web ‚  

The code shown in Listing 2 is included in the source code for this appendix as VFP8 RUNTIMES.ISS.

Listing 2.These script entries install the VFP 8 runtime support libraries and other related files. The {cf} constant points to the Common Files directory on the user ‚ s system, and {sys} points to the Windows system directory. Note that the GDI+ DLL needs to be present before attempting to register the VFP8 runtime DLL, so the GDI+ DLL is installed first.
 [Files]  ; Microsoft Visual FoxPro 8.0 Runtime Support Libraries  ; Microsoft Graphics Device Interface Plus (GDI+) DLL   Source: C:\Program Files\Common Files\Microsoft Shared\VFP\gdiplus.dll;  DestDir: {cf}\Microsoft Shared\VFP; Flags: sharedfile uninsneveruninstall  restartreplace   Source: C:\Program Files\Common Files\Microsoft Shared\VFP\vfp8r.dll; DestDir:  {cf}\Microsoft Shared\VFP; Flags: regserver sharedfile uninsneveruninstall  restartreplace  Source: C:\Program Files\Common Files\Microsoft Shared\VFP\vfp8t.dll; DestDir:  {cf}\Microsoft Shared\VFP; Flags: sharedfile uninsneveruninstall restartreplace  Source: C:\Program Files\Common Files\Microsoft Shared\VFP\vfp8renu.dll;  DestDir: {cf}\Microsoft Shared\VFP; Flags: sharedfile uninsneveruninstall  restartreplace  ; Microsoft Visual C++ 7.0 Runtime DLL  Source: C:\WINNT\System32\msvcr70.dll; DestDir: {sys}; Flags:  uninsneveruninstall onlyifdoesntexist  ; Microsoft HTML Help Runtime Files for Visual FoxPro 8.0  Source: C:\Program Files\Common Files\Microsoft Shared\VFP\foxhhelp8.exe;  DestDir: {cf}\Microsoft Shared\VFP; Flags: sharedfile uninsneveruninstall  restartreplace  Source: C:\Program Files\Common Files\Microsoft Shared\VFP\foxhhelpps8.dll;  DestDir: {cf}\Microsoft Shared\VFP; Flags: regserver sharedfile restartreplace  uninsneveruninstall   ; ActiveX Controls --> {sys} directory   Source: C:\WINNT\System32\mscomctl.ocx; DestDir: {sys}; Flags: regserver  sharedfile restartreplace   [Run]   Filename: {cf}\Microsoft Shared\VFP\Foxhhelp8.exe; Parameters: /RegServer  
 
Note ‚  

When installing the VFP runtime files you must include at least one language resource file. Listing 2 includes the U.S. English resource file VFP8RENU.DLL. Your application may require a different resource file or perhaps even more than one resource file. In any case, the syntax is the same ‚ only the file name is different.

As you can see, Listing 2 makes use of some flags we haven ‚ t talked about yet. These flags are typically used only with system files and registered controls such as ActiveX files. Here ‚ s what they mean:

  • regserver registers a DLL or ActiveX control (OCX)

  • sharedfile means this component is likely to be shared by more than one application. It tells the installer to increment the Windows shared file count for this file so the file is not removed during uninstallation if another application still requires it.

  • uninsneveruninstall means never uninstall this file. Use of this flag with the VFP runtime files is discretionary. If you are configuring a machine to run several VFP 8 applications, you may want to install the VFP runtime files once and use this flag to be sure they stay put for future use even if the original application is removed. In fact, some developers like to create a workstation setup package that installs nothing but the VFP runtime files. Regardless of how you install them, using the uninsneveruninstall flag with the VFP runtime files helps avoid breaking other VFP applications when one VFP application is uninstalled .

  • restartreplace is used to handle situations where the file being installed already exists but is locked at installation time. If this situation is encountered and the restartreplace flag is present, the installer prompts for a reboot after installation and replaces the file when the system is restarted.

Controls distributed in the form of an EXE file, such as FOXHHELP8.EXE, are registered by running them with the /Regserver parameter following installation. The entry in the Run section of Listing 2 illustrates how to do this in Inno Setup. Note that this entry should be placed first in the Run section of your script, or at least before any other entries in that section that launch something, such as the application itself, that requires the controls to be registered.




Deploying Visual FoxPro Solutions
Deploying Visual FoxPro Solutions
ISBN: 1930919328
EAN: 2147483647
Year: 2004
Pages: 232

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net