1. Big file ...

Assume, I have written an .ex program with some picturefiles, sounds etc.
How can I put all that stuff into ONE .exe file?

Thanks

Stefan

new topic     » topic index » view message » categorize

2. Re: Big file ...

>Assume, I have written an .ex program with some picturefiles, sounds
>etc.
>How can I put all that stuff into ONE .exe file?

If you are thinking of .WAV and .BMP files. (Or other files, other than
.e files), then... You can't. Well, it could be possible, but difficult
and would take up 3+ times the HD space. You should just PKzip them all
together when you want to send it.

But you can use BIND to make an .EXE from the .EX and .E files.
BIND PROGRAM.EX will make PROGRAM.EXE.

new topic     » goto parent     » topic index » view message » categorize

3. Re: Big file ...

Stefan Meyer wrote:
> Assume, I have written an .ex program with some picturefiles, sounds etc.
> How can I put all that stuff into ONE .exe file?

You could make a program to add all that data directly in a .e file and
include it in your program, then bind it, and there you have one big
File. Althrough, the program has to fit in memory and the will need more
HD-space cause you just can't say --> data = "DJSRIOERERRE" <-- You have
to cut it after 256 bytes ( a line longer than that will cause an error)
and you have to replace any escape codes with this method. So every 250
bytes you'll at least 3 extra bytes, and you need bytes to replace the
escape codes.

Rule is: Don't
Best alternative for easy packing is: put all your data in one file and
your program in another (like perhaps Lion King does).
You can put it all in one file by yourself. You can use Daniel
Berstein's compression routines or you can use EDOM (althrough it is
even slower than the compression routines and will generate a file which
is a bit longer, it does load and save easy). With edom you can just put
all the data of the files in one sequence and then call "edo_save
("data.dat", my_sequence}"
        Then your data will be compressed in the file (but with the total
sequence structure in tact.)
        If you think it is too slow, wait for EdoM 2.
        You can BTW if you know the file sizes, copy all the files to one using
the dos-command: "copy file1+file2+file3+file4 data.dat"
        Then simply open data.dat, (you only have to know the filesizes of each
file)

Hope this helps..

Ralf Nieuwenhuijsen
nieuwen at xs4all.nl

new topic     » goto parent     » topic index » view message » categorize

4. Re: Big file ...

On Wed, 24 Sep 1997, Stefan Meyer wrote:

> Assume, I have written an .ex program with some picturefiles, sounds etc.
> How can I put all that stuff into ONE .exe file?

It's possible to munge it all together with Euphoria, but I wouldn't
recommend that. I prefer to use a method I described a while ago for
Jiri's "Aliens" game.

1. Make a backup of your program, pictures and sounds in case something
goes wrong below.

2. Get hold of a copy of PKZip (you should be able to do this for any
self-extracting archiver, but the below is optimized for PK).

3a. You might like to bind a main executable at this stage, although you
don't have to...

3b. Zip all of the files (program etc.) into a zipfile (note the use of
the tilde '~', you might have to remove a character to fit it in):

        PKZIP ~[FileName] PROG.EX(E) EFILES.E WIBBLE.E (if you haven't
bound them already).

        e.g. PKZIP ~ALIENS ALIENS.EXE *.WAV
             -- I'd made sure the .WAVs were the only ones in my work
             -- directory

4. Make a SFX archive:

        ZIP2EXE ~[FileName]

  e.g.  ZIP2EXE ~ALIENS

5. Delete all files except the ~[FileName].EXE (This is why I told you to
make a backup of the files)

6. Create a batch file along the following lines (don't include the
bracketed comments):

-----------------------------------------------------------------------
REM [FileName].BAT (no tilde '~' here)
@ECHO OFF

MKDIR ~[FileName].TMP (create a temporary directory)
COPY ~[FileName].EXE ~[FileName].TMP (copy the SFX into the temp.dir.)

CD ~[FileName].TMP (move to the directory)
~[FileName] (extract the files)
[FileName]  (run the program)

ECHO Y | DEL *.* (we've done, remove files)
CD .. (move back to where we were)

RMDIR ~[FileName].TMP (get rid of the temp.dir.)

ECHO Done!
-----------------------------------------------------------------------

e.g. My "Aliens" batch file looked like this:

-----------------------------------------------------------------------
REM ALIENS.BAT
@ECHO OFF

MKDIR ~ALIENS.TMP
COPY ~ALIENS.EXE ~ALIENS.TMP

CD ~ALIENS.TMP
~ALIENS
ALIENS

ECHO Y | DEL *.*
CD ..

RMDIR ~ALIENS.TMP

ECHO Done!
-----------------------------------------------------------------------

And so all of the program and support files are stored within one .EXE

--
Carl R White   | e-mail...:                    crwhite- at -comp.brad.ac.uk
               | finger...:             crwhite- at -dcsun1.comp.brad.ac.uk
               | web......: http://www.student.comp.brad.ac.uk/~crwhite/
Anti-Spam: Remove x's from header and change '- at -' to '@' in .sig

new topic     » goto parent     » topic index » view message » categorize

5. Re: Big file ...

> >Assume, I have written an .ex program with some picturefiles, sounds
> >etc.
> >How can I put all that stuff into ONE .exe file?
>
> If you are thinking of .WAV and .BMP files. (Or other files, other than
> .e files), then... You can't. Well, it could be possible, but difficult
> and would take up 3+ times the HD space. You should just PKzip them all
> together when you want to send it.

WRONG!!! you can! The proof if my "Install Kit" (available at my
homepage".
It's not very easy to achieve, but not that dificult...
Here's the trick:

1.- Take note of the length of each fils you want to attach to your
EXE file.

2.- Copy all these files into just one, with "copy /b" (take note of
the order the files are stored in this new file).

3.- Inside your Euphoria file (.ex) code the routines that access
the file(s) that will be attached, in the following  way:
        -Create a global variable called "AppLen" of type atom.
        -To access the first file contained in the attachment use a code
        like:
                fn = open("myexe.exe","rb")
                seek(fn, AppLen + 1)
                ... read information...
                close(fn)

           Where "myexe.exe" is your application name.

        -To access the second file in the attachment:
                fn = open("myexe.exe","rb")
                seek(fn,AppLen + File1 + 1)
                ......
                close(fn)

          Where File1 if the length of the first file in the attachment (I
           told you to write it down!)

        - So you access *any* file in the attachment with something like:
                seek(fn,AppLen + SumFile + 1)

                Where SumFile is the sum of the lengths of the previous files
                stored in the attachment.

4.- Put in the very last line of your code the statement "abort(0)"
and then a blank line.

5.- Now create your EXE file with BIND, and take note of the size of
the executable.

6.- Go back to your .EX file and initialize the global variable
AppLen with the length you noted above.

7.- BIND again your application and check that the exe file hasn't
changed. If it has changed go back to point 5.

8.- Using "copy /b" bind your .EXE file with the attachment file you
created.

9.- Enjoy it!!!

Note: The "abort(0)" is required so Euphoria stops scanning your code
before reaching the attached binary information.


Regards,
  Daniel Berstein
  danielberstein at usa.net
  http://www.geocities.com/SiliconValley/Heights/9316

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu