Page 1 of 2

PureSFX - SelfExtracting ZIP Archiver

Posted: Tue Jun 06, 2006 6:57 pm
by Inf0Byt3
Hi! I finished a very very small compressor that creates SFX archives. The stub is ~ 50kb. Freeware and source included.

File as zip->PureSFX.zip
Image

File as EXE->PureSFX.exe
Image

Enjoy!

Posted: Wed Jun 07, 2006 2:19 am
by White Eagle
Thank you! Very cool and very useful! I think this would be ideal for making level paks for my games. :wink:

Posted: Wed Jun 07, 2006 9:26 am
by gnozal
Just a hint.
With PureZIP you don't need a temp file. If your SFX is STUB(EXE)+ARCHIVE(ZIP), you can directly extract from the SFX (recognized by PureZIP as an archive).

Code: Select all

If PureZIP_Archive_Read(GetFullSFXPath())
  ReturnValue.l = PureZIP_Archive_FindFirst() = #UNZ_OK
  While ReturnValue = #UNZ_OK
    PureZIP_Archive_Extract(MyExtractionPath.s, #True)
    ReturnValue = PureZIP_Archive_FindNext()
  Wend
  PureZIP_Archive_Close()
EndIf

Posted: Wed Jun 07, 2006 11:04 am
by Inf0Byt3
Wow!!! Thank you very much Gnozal! That's wonderfull. I'll improve PureSFX right now. :D

Posted: Wed Jun 07, 2006 12:44 pm
by Inf0Byt3
Hi! You can now download the new version of PureSFX.

Update 1
-The progressbars are fixed
-The stub doesn't need a temporary directory anymore.

Posted: Sun Jun 18, 2006 3:07 am
by eJan
Thanks Inf0Byt3.
When I have tryed to compress AceUtilites.exe "au.exe" size: 1.386.496 bytes - everything goes fine, when extracted size is: 1.333.248 bytes and file is damaged. Same thing with "ACDSee8Pro.exe" size: 14.233.600 bytes > extracted: 13.668.352 bytes. Method used to cempres these files: I have created empty folder on Desktop, added "ACDSee8Pro.exe", for compression I have selected that folder.

Posted: Sun Jun 18, 2006 2:01 pm
by Inf0Byt3
I guess that's a limitation in the PureZIP library for now... I'll test it and tell you if I find something.

Posted: Sun Jun 18, 2006 5:02 pm
by gnozal
Please note that you need the beta libs when using PureZIP because of the ReadData()/Eof() purebasic bug.
Reference : http://www.purebasic.fr/english/viewtop ... c&start=44

Posted: Sun Jun 18, 2006 9:27 pm
by Inf0Byt3
Oh, so that was it... Thanks for the reference, Gnozal, I'll repack PureSFX and upload it.

[Update]

Same links, fixed all the bugs and included PureZIP Beta :D.

Posted: Wed Aug 02, 2006 7:21 am
by ..::Origin::..
Hey again Infobyte, are you able to include the 'Beta' version of PureZIP? (The library that is) I can't seem to run it with the latest version of PureZIP.

Thanks,
Ori!

Posted: Wed Aug 02, 2006 7:34 am
by gnozal
..::Origin::.. wrote:Hey again Infobyte, are you able to include the 'Beta' version of PureZIP? (The library that is) I can't seem to run it with the latest version of PureZIP.
Could you give more details ? What's the problem?

The latest PureZIP version installs the thread-safe lib version in subsystem 'UserLibThreadSafe'. So if you have thread-safe enabled, either use jaPBe (is automatic) or add this subsystem in the PBIDE in order to use the correct PureZIP version.

Posted: Wed Aug 02, 2006 7:40 am
by ..::Origin::..
I get errors like:

Code: Select all

         PureZIP_SetCallback(@PureSFXCallback())

Code: Select all

Error: PureZIP_Callback() is not a function, array, or linked list
EDIT: Acctualy, Thats the only error.

EDIT2: Okay, taking a closer look at it, I don't seem to require that line. What does it do anyway? I'm not familiar with the PZ library.

Posted: Wed Aug 02, 2006 7:48 am
by gnozal
..::Origin::.. wrote:I get errors like:

Code: Select all

         PureZIP_SetCallback(@PureSFXCallback())

Code: Select all

Error: PureZIP_Callback() is not a function, array, or linked list
EDIT: Acctualy, Thats the only error.

EDIT2: Okay, taking a closer look at it, I don't seem to require that line. What does it do anyway? I'm not familiar with the PZ library.
About the callback :
Old function PureZIP_SetCallback() was renamed to PureZIP_SetProgressionCallback(), and there is a new function PureZIP_SetCompressionCallback().
PureZIP_SetProgressionCallback() wrote:Set PureZIP progression callback address for the functions :
- PureZIP_ExtractFiles()
- PureZIP_AddFiles()
The callback is called each time a new file is processed.
Usefull to indicate the progress when many files are packed / unpacked.
PureZIP_SetCompressionCallback() wrote:Set PureZIP (de)compression callback address for the functions :
- PureZIP_Archive_Compress()
- PureZIP_Archive_Extract()
- PureZIP_ExtractFile()
- PureZIP_AddFile()
- PureZIP_ExtractFiles()
- PureZIP_AddFiles()
The callback is called in realtime during compression or decompression.
Usefull to indicate the progress when a big file is packed / unpacked.
See the new MiniZIP/MiniUNZIP sources for an example using both callbacks.

So your old code

Code: Select all

         PureZIP_SetCallback(@PureSFXCallback())
can probably be translated to

Code: Select all

         PureZIP_SetProgressionCallback(@PureSFXCallback())

Posted: Wed Aug 02, 2006 8:17 am
by ..::Origin::..
Thanks for that, Thats the command.

Just a minor-minor bug to report:
Empty directories are not included/created when Extracting.

Nothing major :) GW Info! <3 it

Posted: Wed Aug 02, 2006 11:33 am
by gnozal
..::Origin::.. wrote:Just a minor-minor bug to report:
Empty directories are not included/created when Extracting.
Use option #PureZIP_RecursiveZeroDirs to add empty directories to an archive (workaround), as option #PureZIP_Recursive doesn't do it anymore