Mandy,
First, you say, "where if you double click the exe file, as long as vfp9 is installed, it will run".
Your aim should be to allow users to run your program
without VFP being installed. I don't know who your program is aimed at, but assuming you are not the only user, is it reasonable for the users to have to purchase and install VFP in order to use your product?
The normal approach would be to distribute certain run-time files with your program. This will allow it to be run independently of VFP. We can give your further advice on that if you need it, but for now, let's concentrate on your main question.
To prevent unauthorised people from running the application, you have a couple of possibilities. One is simply to password-protect it. Prompt for the password when the user launches the executable, and refuse to run if the password is not one that you recognise. Of course, this assumes that your genuine users won't give their own passwords to other people.
Perhaps a better option is to arrange for a hidden file, containing a code that only you know, to be stored somewhere in the user's file system. And to take care not to tell anyone where it is stored or what it contains. Again, refuse to run if the file is not present, or if it doesn't contain the expected code.
Ultimately, though, this sort of method can always be defeated if the perpetrator is determined enough. But you should ask yourself why anyone would want to run your program in this way. Often, developers seriously over-estimate the risks to their intellectual property.
Mike
__________________________________
Mike Lewis (Edinburgh, Scotland)
Visual FoxPro articles, tips and downloads