It is necessary, for example, if the Pack-file is in DataSection and includes all program resources (images, sounds, sprites, etc.).Result = CatchPack(#Pack, *Buffer, Size)
CatchPack
-
- Addict
- Posts: 1443
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
CatchPack
Propose to add the function CatchPack()
Re: CatchPack
+1
This is required for SFX (Self Extracting Files).
This is required for SFX (Self Extracting Files).
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.
-
- Addict
- Posts: 1443
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
Re: CatchPack
I have just tried it and I have successfully managed to create a self-extracting archive of the code (slightly modified example from help).ts-soft wrote:This is required for SFX (Self Extracting Files).
Code: Select all
UseZipPacker()
ProgFile.s=ProgramFilename()
Path.s=GetPathPart(ProgFile)
; Open the packed file
If OpenPack(0, ProgramFilename())
; List all the entries
If ExaminePack(0)
While NextPackEntry(0)
UncompressPackFile(0, PackEntryName(0))
Wend
EndIf
ClosePack(0)
EndIf
Written at the end of the executable file, ready ZIP-archive.
At the end of the record the file size (number of bytes) in the form of long-variable.
You will have a self-extracting ZIP-archive.
Had just tried it and this method works.
-
- Enthusiast
- Posts: 108
- Joined: Wed May 13, 2009 8:38 am
- Location: Arizona, USA
Re: CatchPack
+1User_Russian wrote: ↑Fri Feb 08, 2013 11:14 am
add the function CatchPack()
Re: CatchPack
This would be really useful.
+1
+1
Re: CatchPack
Ezpack supports that
viewtopic.php?p=399040#p399040
viewtopic.php?p=399040#p399040
Re: CatchPack
Thank you Idle, I've totally missed that!
Still, a native func would be nice, but this is awesome. Thank you for making that.
Re: CatchPack
Oh, that's epic! Agreed with nsstudios, a native Procedure to do this would be great, but this is awesome! Thanks a ton!
PB v5.40/6.10, Windows 10 64-bit.
16-core AMD Ryzen 9 5950X, 128 GB DDR5.
16-core AMD Ryzen 9 5950X, 128 GB DDR5.
Re: CatchPack
Thanks nsstudio and quin, yes native would be good.