Adding files into the exe and extracting them
Adding files into the exe and extracting them
How do I add some zip files, dll's, images to the exe file and extract them when the program starts?
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Code: Select all
; Include the file(s) in exe:
DataSection
beginzip: IncludeBinary "somefile.zip" endzip:
EndDataSection
; Write them to disk at runtime:
If CreateFile(0, "somefile.zip")
If WriteData(0, ?beginzip, ?endzip-?beginzip)
; success
Else
; error message
EndIf
CloseFile(0)
Else
; error message
EndIf
BERESHEIT
- Rook Zimbabwe
- Addict
- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
- Fangbeast
- PureBasic Protozoa
- Posts: 4789
- Joined: Fri Apr 25, 2003 3:08 pm
- Location: Not Sydney!!! (Bad water, no goats)
The trouble with including loads of things inside an exe (as I understand it) is that the entire thing has to be loaded into memory first, which includes everything inside the exe and that could impact on any machine not having enough RAM.
Might be more efficient and useful to include a resource bin that doesn't get loaded into memory. One such useful thing that comes to mind is DoubleDutch's DBIN.
You might want to check out
http://www.purebasic.fr/english/viewtop ... n&start=45
Might be more efficient and useful to include a resource bin that doesn't get loaded into memory. One such useful thing that comes to mind is DoubleDutch's DBIN.
You might want to check out
http://www.purebasic.fr/english/viewtop ... n&start=45
- Rook Zimbabwe
- Addict
- Posts: 4322
- Joined: Tue Jan 02, 2007 8:16 pm
- Location: Cypress TX
- Contact:
I click on the link in the purearea.net website and it simply displays the info about PBOSL No download!
Ahhh I see... you have to download the entire PBOSL... No one exactly mentioned that!
Ahhh I see... you have to download the entire PBOSL... No one exactly mentioned that!

Last edited by Rook Zimbabwe on Mon Aug 11, 2008 3:27 pm, edited 1 time in total.
- Kaeru Gaman
- Addict
- Posts: 4826
- Joined: Sun Mar 19, 2006 1:57 pm
- Location: Germany
wasn't there an integrated ressources manager since 4.0 or so?Fangbeast wrote:Might be more efficient and useful to include a resource bin that doesn't get loaded into memory. One such useful thing that comes to mind is DoubleDutch's DBIN.
I'm not sure how it works, didn't use it yet...
oh... and have a nice day.
> The trouble with including loads of things inside an exe (as I understand
> it) is that the entire thing has to be loaded into memory first, which
> includes everything inside the exe and that could impact on any machine
> not having enough RAM.
I've heard that too, but nothing beats a self-contained single executable.
> it) is that the entire thing has to be loaded into memory first, which
> includes everything inside the exe and that could impact on any machine
> not having enough RAM.
I've heard that too, but nothing beats a self-contained single executable.
