Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Encrypting forms in an app that is not to be compiled into an exe. 1

Status
Not open for further replies.

mKopet

Programmer
Sep 6, 2002
1
US
When creating a VFP project that contains many programs, forms and libraries, is there a way to have the forms encrypted, but without using a single .exe that contains all the files?

The application we are setting up can be compiled into a single .exe and this works fine as far as encryption and all programs and forms being able to see each other. But the managers have requested (or insisted) that the application be broken up into smaller pieces so that upgrades are easier for the customer to download, since many changes will be made and sent out almost daily for at least a few months.

With about 290 .prg files and over 400 forms, the manager's acceptable solution is to use encrypted .fxp's. But how can the forms be encrypted and seen by other programs and forms?

Any one form or program can be called by any one or more program or other form.

We have tried building an .exe for a form and setting it as main in the project, but parameters are not passed, . . .
We have considered creating an .exe for each form, creating a .prg to set as main, where the prg will just call the form with the parameters received, but this of course is a lot of work to do for 400 forms.

Is there any way to do this other than with a single .exe?
That is the sad thing, is that the application runs completely fine using a single .exe. But sending out a 20MB .exe each time a small fix is done is not acceptable to the managers.

 
Is there any way to do this other than with a single .exe?

I cannot recall ever seeing an encryption software that also does apps. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
mKopet,
I think you can put your form(s) together with associated prg(s) and build an app instead of exe.
It's just a thinking.
Regards
mansii
 
Hi mkopet,

This can be achieved in a difefrent way..

LOCAL laFile(1)
IF ADIR(laFile,"MYFORMS\u"+cMyForm+".SCX","ARS") > 0
DO FORM (laFile(1,1))
ELSE
DO FORM cMyForm
ENDIF

Always, the downloaded form should be supplied with a "u" as prefix and they can keep it in the MyForms directory. If the applications finds one, that will be run, or else, the built in EXE contained one will be run.

Once in a way, when the new executable is released, the directory can be deleted and the new execuatable replaced.

Another advantage is that, user level customisation can be done in individual forms without changing the standard executable.

:) ramani :)
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
simple!!!!!

I guess you have the forms in a map under the exe that actually calls the forms through a menu.

do as follows:

make a copy of the entire development environment for this project:
CD to that copy

exclude the forms from your project (rightclick on them and choose exclude).
recompile the project and recompile EVERY file (meaning also the excluded forms).

Now comes the tedious job. At least, the first time that is
type in the commandwindow,
use forms/MyForm.scx &&use the extension otherwise VFP looks for a dbf that it can't find!!
replace all Methods with chr(0)
* this clears all teh readable code from the methods field, leaving the objcode fields intact.
Close the form-table

repeat this with every form.

As said, MAKE A COPY FIRST. Replacing the methods field with chr(0) empties the methods field where you actually created the code for the events and methods first.
Compiling a form places precompiled code in the objcode field. This is all VFP needs to run your form, or your classlib (VCX, same structure) or your report (FRX, same structure) or your menu (MNX, same again).

whenever you have to modify a form all you have to do is copy that form to the distrib environment and repeat the steps above for that one form.
The result is that your customer receives a form he/she cannot read or alter without disturbing anything. (which I hope they will not do anyway).

HTH

Boudewijn Lutgerink
Boudewijn.Lutgerink@foxite.com, The home of the Visual FoxPro experts
use
 
Boudewyn

Now comes the tedious job. At least, the first time that is


Good solution, but this can all be automated with a neat little function, that can be triggered and run everytime they are changes to the project. Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top