Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to copy a file included in exe to disk ?
Message
From
22/10/2001 04:10:14
 
 
To
19/10/2001 23:45:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00571203
Message ID:
00571556
Views:
23
You don't actually need to put it in a memo field (although that solution works fine)

What I do is..include the file in the .exe
then extract it as follows
lcStr = FileToStr('myfile.fl_')
=StrToFile(lcStr,'c:\temp\myfile.fll')
HTH

Will

>Thank you Sergey, that worked.
>
>I first tried placing the files in the same dir as the pjx, thinking that that would work. In that case the COPY command looks for the source file ('xxxx.fl_') in the same directory as the exe file, where it is not present, of course.
>
>Since you can say SELECT * FROM yyy.frx INTO TABLE yyy2.frx if yyy.frx is contained in the project (I'm pretty sure I've done that) I expected the copy command to access internal files too.
>
>Alex
>
>>>Hi,
>>>
>>>My program needs an fll to decrypt data files. In order to copy the fll to disk upon the first run, I include a slighty renamed file (xxxx.fl_) in the project and then compile the exe. When the program is run, if file xxxx.fll is not in current directory, I say COPY FILE 'xxxx.fl_' TO 'xxxx.fll'.
>>>
>>>The problem is that during development file 'xxxx.fl_' is in a subdirectory under the pjx file and at runtime the COPY command looks for the file in that subdirectory (which doesn't exist) instead of in the exe. How can I solve this problem without copying 'xxxx.fl_' into the same directory as the pjx file?
>>>
>>>Thank you very much.
>>>
>>>Alex
>>
>>Create a table with a memo field, add one record and stuff your dll into the memo field using Filetostr and replace. Include this free table into your exe. In the EXE open the table and copy the dll out using Strtofile.
Will Jones
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform