BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: Embedding a file in a project

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Non-Technical)
View previous topic :: View next topic  
Author Message
Yahia El-Qasem
Guest





PostPosted: Tue Nov 25, 2003 12:00 pm    Post subject: Re: Embedding a file in a project Reply with quote



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





PostPosted: Tue Nov 25, 2003 3:10 pm    Post subject: Re: Embedding a file in a project Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Non-Technical) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.