PDA

View Full Version : New person that wants to ask a question..



bookhead
09-09-2009, 18:45
It has something to do about embedding all media resources that your program opens to be used, into either one file, or the executable.

Is that really possible to do in thinBasic?

This is the thing that every single programming language is missing except for C++.

Petr Schreiber
09-09-2009, 19:17
Hi bookhead,

and welcome to the forums!

I think the common way of doing this in compiler world is putting media to resource file, which is widely supported technique (I used it in PowerBASIC, Pelles C, ...).
I have no idea how media embedding is done in C++, besides the resource files. Any example would be appreciated :)

ThinBASIC scripts can be "bundled", that means making single executable, which internally holds interpreter core, obfuscated script, any needed DLLs and if necessary, even user defined files.

Those files are expanded to disk as "hidden" before the execution starts, and cleaned up after the execution ends.

Which kind of media for which kind of application do you need this functionality?


Best regards,
Petr

Michael Hartlef
09-09-2009, 20:18
It has something to do about embedding all media resources that your program opens to be used, into either one file, or the executable.

Is that really possible to do in thinBasic?

This is the thing that every single programming language is missing except for C++.


Hello bookhead. Look at BlitzMax, it has what you need. INCBIN is the magic keyword.

bookhead
09-09-2009, 23:37
Is incbin the tool to use for thinbasic? Because I was looking for a method like that available for thinbasic.

The type of files I wanted to have embedded is picture files, like bmp, m15 model, sound files, and maybe text files.

You also mentioned blitzmax. Which is pricey to me so no thanks.

Michael Hartlef
09-09-2009, 23:58
Incbin is a Blitzmax keyword, no Tool. But it could be that the bundle feature of thinbasic can also bundle Media files and complete folders. I never tried it myself.

Petr Schreiber
10-09-2009, 10:37
Another option could be "the Id Tech way", which means creating one big ZIP file with all media files, and extract them on demand. ZLIB is included with ThinBASIC.

ErosOlmi
10-09-2009, 11:28
Hi bookhead,

welcome to thinBasic community forums!

Yes, thinBundle can creates executables with files embedded in the exe. You can also add directory structures.
All files and directories will be extracted/created at runtime and removed when script finish its execution.

Maybe we need to improve a bit thinBundle on this side. For example adding possibility to be able to specify which files to leave on disk, which files to extract only once, ... and so on but that's it.

Try by yourself.
Open your script.
Go to thinBundle.
You will find already listed needed files.
Click on "Add file" or "Add folder"
Bundle it into an exe.
Copy the exe into and empty dir and see results.
All files will be extracted as system+hidden so if you want to see them activate your Explorer to show system+hidden files.

Ciao
Eros