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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to run a VFP9 exe on a Computer that has not VFP installed 7

Status
Not open for further replies.

german12

Programmer
Nov 12, 2001
563
DE
I'm using Visual Foxpro 9.
Now I have tried for the first time to install an application (which runs perfectly in the Foxpro environment for me (on computer no. 1)) on a foreign computer. This computer (I'll call it Computer2 here) doesn't have a Foxpro program on board.
On my computer I built an exe file of the starter program (prg) and copied all files in the folder to a USB stick.
Then I read to provide the 2 support files with that - but I only found VFP9ENU.dll in my VFP directory for VFP 9 - but not another file with the name VFP9.dll
I also copied VFPENU.dll to the stick and copied its contents into a directory on Computer2.
When I start the exe file on Computer2, the message appears:
"cannot locate the Microsoft Foxpro support library."

This is my question:
a) Where can I find the necessary VFP9.dll on computer no. 1?
b) have I forgotten any other actions?

Thanks in advance.

Klaus

Peace worldwide - it starts here...
 
Hi Klaus,

Your best bet is to build a Setup program. This is a stand-alone EXE that your users can run on the computers, and which does all the setup that is required for your app.

You can build a Setup program using InstallShield Express, which comes with VFP. But there are other possibilities as well. My preferred method is to use Inno Setup. It is fairly simple - and free. Essentially it involves writing a script which specifies which files are to be installed, and where you need to install them. It also handles registration of DLLs and updating registry entries.

It's also possible to do the whole thing manually, but I suggest you at least have a look at the above first.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Mike,
thanks for your prompt answer.
I tried it, to use Install Shield Express when I wrote my request, but that failed for any reason.
I will try it with Inno Setup (hope to find it) and will report whether success or not.
Still open is my question where I could find that VFP9.dll (it was not to be found in the main VFP directory.)

I think it is a necessary file as far as I had read it.

Regards
Klaus




Peace worldwide - it starts here...
 
Klaus

I Always copy the *exe file created in my develop machine with these support files:

gdiplus.dll
msvcr70.dll
msvcr71.dll
vfp9r.dll
vfp9rchs.dll
VFP9RENU.DLL
vfp9t.dll
vfpoledb.dll

Put this files in the same directory of the *.exe file. Some of these files are not always necessary, but I copy all of them anyway.

Mauro

 
Hi German12,

memarques has already given a list.
However, I saw that a few that I usually copy, are missing. Not sure those are cause of your problem.
So, below is list of files that I copy.

GDIPLUS.DLL
MSVCR71.DLL
MSVCP71.DLL
VFP9ENU.DLL
VFP9R.DLL
VFP9RENU.DLL
VFP9T.DLL
MSVCRT.DLL
MSVCRT40.DLL
VFP9RDEU.DLL

Rajesh
 
Hi german12,

it might be helpful for you, to open the VFP helpfile (F1) and study some parts of it concerning compiling and distributing applications.
You will find them within the 'CONTENT' (Inhalt) tab.

After that click on
[+] Using Visual Foxpro
[+] Developing Visual Foxpro Applications
[+] Compiling an Application

[+] Using Visual Foxpro
[+] Developing Visual Foxpro Applications
[+] Distributing Applications

After reading the Compiling and Distributing chapters you will understand, why mauro and Rajesh place some very important DLLs into their setup routines.

On FoxWiki you will find a good overview of what each DLL does, what it is needed for and where you can find it. This may help a lot, too.
[URL unfurl="true"]http://fox.wikis.com/wc.dll?Wiki~VFP9RuntimeFiles[/url]
Though the above article says that some DLLs have to be registered.... I never registered those DLLs. I simply place all of them in the EXE folder and VFP will use them correctly. That way there is no fiddling with other VFP setups using other service packs or whatever.

To make a long story short: Distributing a VFP Application for the first time isn't an easy task. It is a process of learning and trial and error. It starts with building the project correctly and ends with the correct setup routine.

JM2C


-Tom
 
Hi German12,

As Tom Borgmann mentioned, I also never had to register any of the DLLs of VFP.
They simply need to be there in your application folder.

Rajesh
 
Klaus, if you decide to go down the Inno route that I suggested earlier, here are a few links to get you started:


In my opinion, it's worth taking the time to learn Inno Setup, especially if you are likely to be installing other applications in the future. But if you prefer to do the setup manually, the advice you've been given by others in this thread should help you get the job done.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mauro & Rajesh,
thank you very much for the list of support .dll-files.
I looked up in my VFP-directory but could find a few of that .dll-files only.
Where are the other ones to be found?
Where did you get them from?

Klaus



Peace worldwide - it starts here...
 
These are the files I found in my directory (c:\programme(x86)Microsoft Visual Foxpro 9:
VFP9CHS.DLL
VFP9CHT.DLL
VFP9ENU.DLL
VFP9KOR.DLL

That's all there.

Klaus

Peace worldwide - it starts here...
 
Thank you, everyone who helped me very well here. I think I would have needed a lot more time to solve my problem - maybe I would even have given up.
Now I am very happy that the * .exe file runs on a computer without VFP.
One tiny problem now remains:
I have 2 forms - and one form has an "Exit" button with the following click-code:

Clear events
Thisform.Release

That's ok when I work with the Foxpro environment - but with
using it as an * .exe file brings me to a Foxpro window
back.

But then of course I would like to be in the Windows environment again.
What must be the code for the click event?

Klaus

Peace worldwide - it starts here...
 
Hi,

The most simple way is to add

Code:
Clear events
Thisform.Release

Close All
Clear All
Clear
Quit

Nevertheless you may want to check if
[ul]
[li]the data has been saved[/li]
[li]...[/li]
[li]all parameters/variables/environment settings/... you have changed have been reset to default[/li]
[/ul]

hth

marK
 
Klaus, when you say that you get the "Foxpro window", I assume you don't mean the VFP development environment, but rather the outer window that normally contains your forms, menus, toolbars, etc?

If so, you need to add code the your main program. When you execute CLEAR EVENTS, control returns the line of the main program immediately after your READ EVENTS. It is at that point that you need to close the application. This would normally involve closing all open forms and releasing all objects. Once you have done that, you can issue QUIT to actually terminate the application.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Forms20201030_230043xx_ffxjof.jpg


When developing a * .exe (standalone) I try to do it with a very simple program.
As you can see from the drawing, I only have 2 forms (forma and formb) and one program (start.prg).
My code can be seen on the drawing to the right of the respective click buttons.
When I run start.prg, the first form (forma) appears.
That's OK. (forma becomes visible)
When I click command-button1 on forma ("go to form b"), formb becomes visible.
Also the way back (when I click command1 ("back to form A") is ok.
But, if I want to leave the program completely (by clicking Command 2 on forma ("exit")) an error message appears
with the title: "cannot clear the object command2 because it is in use".

Somehow something is wrong in my code - and of course that has an effect when I create an * exe file of the program.
Can someone help me there?
Thank you in advance.
I hope my explanation was understandable.

Best regards
Klaus




Peace worldwide - it starts here...
 
Hi,

There are several quirks,

- in the click code of FORMB replace DO FORMA with FORMA.SHOW()
- in the Exit.Button of FORMA replace all the code with the line "ThisForm.Release()"
- in your Start.prg add between READ EVENTS and CLOSE ALL the Line CLEAR EVENTS

hth

MarK
 
Thanks Mark, and all others.

Thanks, that helped me a lot.
18 years ago I was unable to access the whole new world of Foxpro with object-oriented programming because of a lack of time
to understand.
Back then, Foxpro was already helping me a lot as a controller - I was able to gain information from very large databases, especially with queries (SQL), in order to explain deviations between budgets and actual costs.
Now that I've been retired for a long time, I'm still trying to learn this wonderful quality in small steps.
I have a lot of fun - especially because it's so unusual.
Maybe that explains better why I always ask trivial questions here.
But over the years I've learned that I get always very qualified answers here - and I'm very grateful for that.
It's a shame that we all live all over the world, because then I'd like to buy one beer for everyone.
Stay safe friends!

Klaus

Peace worldwide - it starts here...
 
In connection with an * .exe installation, I always notice that Foxuser.dbf + Foxuser.fpt can still be found under all files, but I don't know what to do with it.
I read faq184-11, but it was written in 2000 - VFP 6.0 was probably still in use.
But I have VFP 9.
What are you doing with the Foxuser file today? Just delete it, or integrate it into the project - or what else?

Greetings from Lower Saxony.
Stay healthy.
Klaus

Peace worldwide - it starts here...
 
Hi Klaus,

while working with VFP you will have noticed, that i.e. command window content, window positions and so on are remembered. This is all stored with VFPs own foxuser file.
By default, as soon as a VFP exe is started, the VFP runtimes will look out for a specific foxuser within the EXEs working directory. If the file doesn't exist it will be created.
First thing I do is adding a special file to my project called config.fpw. Its placed in the EXEs homedirectory and can contain lot's of VFP terms that are used by VFP runtime by default. One of the optional terms, that can be placed in this file is: RESOURCE=....
If you want to have a special prefilled foxuser.dbf for your EXE, you can place something like this in the config.fpw:

RESOURCE=c:\myApps\foxuser.dbf (for using your own prefilled content)

or

RESOURCE=OFF (for forcing the VFP runtimes to not make use of foxuser.dbf)

I never use foxuser.* within my project/EXE/APPs. Therefore my RESOURCE is OFF by default. However many developers might find the foxuser.dbf rather helpful.

For further informations about the config.fpw file, open VFP help, switch to INDEX tab and start a search for 'config.fpw'.

Code:
[b]RESOURCE = OFF[/b]
COLLATE = GENERAL
CPDIALOG = OFF
CURRENCY = RIGHT
DATE = GERMAN
DELETED = ON
DOHISTORY = OFF
ESCAPE = OFF
EXACT = ON
EXCLUSIVE = OFF
MULTILOCKS = ON
MVCOUNT = 30000
FDOW = 2
FWEEK = 2
HOURS = 24
OPTIMIZE = ON
POINT = "," 
SEPARATOR = "."
TALK = OFF

All the above terms can be part of a config.fpw. Though not all of them are listed within VFPs help file for config.fpw. This might be a bit irritating, but there is something else about config.fpw. You can take every SET command, that you use within your code and place it within your config.fpw. But you have to be careful about this. SET commands that you have to change constantly, might better be not placed there.


-Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top