APPLICATION DISTRIBUTION WITH BRANDED LEVEL II FILES
====================================================

The LEVII_?0.APP's
------------------
                   LEVII_50.APP (VFP 5.0)
                   LEVII_30.APP (VFP 3.0)

These APP's for Visual FoxPro 3.0 and 5.0 allow processing
of the FoxPro application and runtime files to enable
them to be run without affecting existing non-branded
(or differently branded) FoxPro applicationse.  This is
achieved by ensuring the branded FoxPro runtime files
(VFP300.ESL for VFP 3.0 and VFP500.DLL for VFP 5.0)
can be referenced only by the associated branded application.
This requires the EXE file to reference an alternate registry
entry (standard entry is VisualFoxProRuntime for VFP 3.0 and
VisualFoxProRuntime.5 for VFP 5.0).  The new references must
be the same length as the original, so the APP's will pad out
shorter references to the required length with "_" characters
and truncate longer ones.  The registry entry normally points
to the \WINDOWS\SYSTEM directory where the runtime ESL/DLL
typically resides.  It is this reference that when changed
allows the location and name of the runtime file to be
modified to your choice. The dependencies are as follows:

             FoxPro Application EXE
                     \
                       \  (internally holds)
                         \
                     Registry Entry
                             \
                               \    (points to)
                                 \
                             ESL/DLL location
                
Branding Using ReFox and Level II Apps
--------------------------------------
1. Produce your VFP EXE application file(s) as normal,
   with compile set as ENCRYPTED in the project.
        eg C:\MYSTUFF\MYAPP.EXE

2. Copy the VFP500.DLL (or VFP300.ESL) runtime into your
   app directory, and optionally rename.
        eg C:\MYSTUFF\VFP5X.DLL

3. Load ReFox 7.0, ensure options shows Level II Branding.
   Also the timestamp of the VFP DLL/ESL can be changed, this
   would be reflected when issuing a VERSION(1), and may
   therefore help to identify whether a normal or branded VFP
   DLL/ESL is being run.  The timestamp can be modified to
   your own values by means of the Options window, positioning
   the cursor on the Protection Level option and then pressing
   Ctrl-Enter.

4. Press F6 Brand, Select your EXE files and the corresponding
   runtime DLL/ESL, and then enter the branding password.
   Check branding of EXE is successful by selecting and seeing
   if ReFox no longer recognises it as FoxPro code (just displays
   file contents). Quit ReFox.

5. Load Visual FoxPro

6. Run LEVII_?0.APP, parameters are :
        (i) Your new Application Registry entry
       (ii) New location and name of branded VFP runtime DLL
      (iii) Location and name of branded FoxPro EXE (optional)

        eg  =LEVII_50('MyFoxProAPP','C:\MYSTUFF\VFP5X.DLL',;
                                'C:\MYSTUFF\MYAPP.EXE')

7. Run your EXE, which should now work relying only on the
   specified branded VFP Runtime DLL/ESL.

        eg C:\MYSTUFF\MYAPP.EXE

8. This has set up the application in this current environment
   only.  Now decide on your approach to distribution.
   You can distribute the LEVII_?0.APP but this would rely on
   the 'normal' runtime file.  Also must ensure that if 
   the installer changes the directory of your application, it 
   must also reflect this in the call to LEVII_?0.APP. 
        eg if not installed into C:\MYSTUFF as above.

   However, it is likely that your own installer program can
   make Registry updates, so after running LEVII_?0.APP to
   modify the EXE and DLL/ESL files, you just need the installer
   program to update the registry with the same value as passed
   as the first parameter to the LEVII_?0.APP.

   The LEVII_?0.APP's create a LEVEL2.REG registry file so the
   registry options can be seen. Registry files can be imported
   or processed by clicking on them in the Explorer.

Sample LEVEL2.REG file
----------------------

   REGEDIT
   ; Registry entry for ReFox level 2 branded app : c:\vfp5\oli2.exe
   HKEY_CLASSES_ROOT\MyVisualFoxProApp____ = Microsoft Visual FoxPro 5.0 Runtime
   HKEY_CLASSES_ROOT\MyVisualFoxProApp____\shell\open\command = C:\VFP5\VFP500.DLL %1



OTHER APPROACHES
================

Visal FoxPro -D startup switch
-------------------------------
Visual FoxPro can specify an alternate runtime DLL file by use
of the startup switch -D.

        eg  Branded Level 2 DLL located in C:\VFP\RUNTIME

            Start branded VFP apps with
                MYAPP.EXE -DC:\VFP\RUNTIME\VFP500.DLL
 
The disadvantage of this is that users may create shortcuts to the
applications and lose the startup switch, causing the application to
fail with incorrect version errors.


Applications Compiled Non-Encrypted
-----------------------------------
Applications that are not compiled with the ENCRYPT option still
work with a branded level II runtime file.




        email:  xitech@compuserve.com
        tel:    +44 (0)1707 276637 
        fax:    +44 (0)1707 267777 
        web:    http://www.xitech-europe.co.uk
