"AppendData" command to append data to end of exe
"AppendData" command to append data to end of exe
I would like to see a command similar to DataSection but have the data be appended to the end of the file instead of being placed inside the exe section, something like VBin_ or DBin_ but without the need to append after compilation.
This would alleviate problems like this:
http://www.purebasic.fr/english/viewtopic.php?t=31908
Here is a link to DoubleDutch's DBin_ code:
http://www.purebasic.fr/english/viewtopic.php?t=22037
This would alleviate problems like this:
http://www.purebasic.fr/english/viewtopic.php?t=31908
Here is a link to DoubleDutch's DBin_ code:
http://www.purebasic.fr/english/viewtopic.php?t=22037
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
It would be *very* handy. 

https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
- Thorsten1867
- Addict
- Posts: 1372
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Do you mean something like this?
Code: Select all
Procedure AppendData(ExeFile.s, DataFile.s)
; (c) TS-Soft
Protected File.l, Pack.l, Size.l, *mem
If OpenFile(0, ExeFile)
ReadFile(1, DataFile)
Size = Lof(1)
*mem = AllocateMemory(Size)
If *mem
ReadData(1, *mem, Size)
CloseFile(1)
FileSeek(0, Lof(File))
WriteData(0, *mem, Size)
WriteLong(0, Size)
CloseFile(0)
FreeMemory(*mem)
ProcedureReturn #True
EndIf
EndIf
ProcedureReturn #False
EndProcedure
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
It would be very good if this was a built-in system.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
The idea is good.
If you use IncludeBinary, windows load allways the datas with the exe in
memory. Better is to solve this: Using Resources or Append Data.
If you use IncludeBinary, windows load allways the datas with the exe in
memory. Better is to solve this: Using Resources or Append Data.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

With AppenData, if you insert an exe into your exe file, how do you do to extract it from your exe ?
Example : I've got an exe which names install.exe. I want it to include program.exe. I use AppendData, that's OK.
Then I want to tell install.exe to "extract" program.exe from it. How do i do that ?
Thanks in advance.
Example : I've got an exe which names install.exe. I want it to include program.exe. I use AppendData, that's OK.
Then I want to tell install.exe to "extract" program.exe from it. How do i do that ?
Thanks in advance.
Purebasic 6.12 64 bits - Windows 11 Pro 64 bits 23H2
FileSeek Lof(0) - AppendDatalength !
I hope you can with this info write your own code
I hope you can with this info write your own code

PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

The length of the datas you have append! or write the length after the datas
and read this first on the end of the file and then seek back.
and read this first on the end of the file and then seek back.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.

- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
GG: Why don't you just use DBin? If it doesn't do what you want then improve it and resubmit it to the forum.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Didn't know that - thats handy. 

https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system