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

Listing file inside an exe

Status
Not open for further replies.

TheWizard78

Programmer
Jun 28, 2004
18
CA
Hi everybody,

Is there a way to retreive the name of all the files includes in a exe?

I explain.. I have create an application and I have include 20 files in the other files section of my project. Then I just build an exe program with it.

I would like to be able to develop a function inside my exe that I will list all theses files the first time my client will execute this program.

Then I will extract the files to \Windows\system32\ (but this part is not a big deal)

I have think about create a table dbf that will contain the name of theses files and include it inside the exe, but the problem with it, it's everytime time I will add some files, I will have to add them also in the dbf table...

Does anyone have a solution for this

Robert
 
Open the project table as a cursor, eg USE MyProject.PJX. If you look at the NAME memo field, it will show you a path and filename.

Maybe you could write a routine that manipulates this to create a text file of files included in the project/exe which you could then distribute with your exe?

I like work. It fascinates me. I can sit and look at it for hours...
 

Robert,

I have think about create a table dbf that will contain the name of theses files and include it inside the exe, but the problem with it, it's everytime time I will add some files, I will have to add them also in the dbf table...

You could use the project hook class to automate that process. Write code in the QueryAddFile method to update the DBF.

On the other hand, FatSlug's solution sounds promising. The Name field contains the names, including the relative paths, of each file in the project. The Type field tells you what type of file it is. If Type = x, then the Name refers to a member of "Other files".

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Thanks guys for answering me.

Finaly I'm gonna write a routine to update my dbf at compile time.

Robert
 

Robert,

By coincidence, my present client asked for something similar this morning. We have a table that contains the names of all the app's forms. When a program needs to open a form, it gets the name from the table. Unfortunately, we sometimes make mistakes in spelling the form names, so the app throws a "form not found" error. The client asked me to test for the existence of the form before we launch it, but I told him we couldn't do that because the form was bound into the EXE.

I was hoping that whatever solution you found for yourself would also work for me. But the situation is a bit different. Unlike you, I am not concerned about checking what's in the project, only whether a given form has been bound into the EXE.

Out of curiosity, what's your reason for needing to do this?

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Hi Mike,

I just want to do a little program that will extract and register some ocx and dll files before running the main program that use these ActiveX. I know that I can use WISE or a program like that to do it at the first time, but sometime we add some new activex in our development, so client don't have to reinstall the wise, but just run this program for updating the files... Also good for workstation that doesn't install the program with Wise and use the main program over the network.

That's why I'm requesting that.

Thanks

Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top