 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Yahia El-Qasem Guest
|
Posted: Tue Nov 25, 2003 12:00 pm Post subject: Re: Embedding a file in a project |
|
|
there are several ways - it depends on what you want :
a) have one EXE containing everything :
attach the data file to your EXE by "copy /B YourEXE.EXE YourData.File
TheResultingEXE.EXE"...
as long as the size of the data file is known at compile time you could
just open your EXE at startup, seek to the end of EXE file minus the data
file size and read whatever there is...
another idea would be to include the file as a binary resource... though
I am not really familiar with this...
there are commercial product out there that do much more - take a look
at for example : www.aidaim.com
b) speed up the start of your app :
this would need the inclusion of the data file as a static array - not
sure if this works for 3 MB...
you could use a HexEditor which is able to generate a C-like array of a
binary file, then you would add that array to your units and it gets
compiled into your EXE...
HTH
Yahia
|
|
| Back to top |
|
 |
Michael Gillen Guest
|
Posted: Tue Nov 25, 2003 3:10 pm Post subject: Re: Embedding a file in a project |
|
|
I use this approach too. To expand a little, I have two embedded files.
One is a known size, the other is tar file of varying size.
After startup I look for the header of the tar which is always the same
and subtract the length of the known binary. I now know where each file
starts.
I make the program with this copy command.
copy /b MyProgram.exe + binaryimage + tarfile.tgz MyBigProgram.exe
-Michael
Yahia El-Qasem wrote:
| Quote: | there are several ways - it depends on what you want :
a) have one EXE containing everything :
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|