PureSFX - SelfExtracting ZIP Archiver

Developed or developing a new product in PureBasic? Tell the world about it.
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

PureSFX - SelfExtracting ZIP Archiver

Post 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!
Last edited by Inf0Byt3 on Wed Jun 07, 2006 1:29 pm, edited 1 time in total.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
White Eagle
Enthusiast
Enthusiast
Posts: 215
Joined: Sun Jan 04, 2004 3:38 am
Location: Maryland

Post by White Eagle »

Thank you! Very cool and very useful! I think this would be ideal for making level paks for my games. :wink:
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post 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
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post by Inf0Byt3 »

Wow!!! Thank you very much Gnozal! That's wonderfull. I'll improve PureSFX right now. :D
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post 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.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
eJan
Enthusiast
Enthusiast
Posts: 366
Joined: Sun May 21, 2006 11:22 pm
Location: Sankt Veit am Flaum

Post 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.
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post 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.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post 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
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Inf0Byt3
PureBasic Fanatic
PureBasic Fanatic
Posts: 2236
Joined: Fri Dec 09, 2005 12:15 pm
Location: Elbonia

Post 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.
None are more hopelessly enslaved than those who falsely believe they are free. (Goethe)
..::Origin::..
Enthusiast
Enthusiast
Posts: 125
Joined: Sat Jun 17, 2006 3:15 pm

Post 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!
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post 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.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
..::Origin::..
Enthusiast
Enthusiast
Posts: 125
Joined: Sat Jun 17, 2006 3:15 pm

Post 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.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post 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())
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
..::Origin::..
Enthusiast
Enthusiast
Posts: 125
Joined: Sat Jun 17, 2006 3:15 pm

Post 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
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post 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
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Post Reply