Page 2 of 3

Posted: Wed Jan 21, 2009 3:44 pm
by besko
How to write SFX packer with this lib Gnozal :) Tnx

Posted: Wed Jan 21, 2009 4:18 pm
by gnozal
besko wrote:How to write SFX packer with this lib Gnozal :) Tnx
A quick (basic) example :
1. Create the SFX stub :

Code: Select all

;
; EXE stub example
; 
If PureLZMA_Archive_ReadSFX(ProgramFilename())
  ArchiveInfo.LZMA_ArchiveInfo
  If PureLZMA_Archive_FindFirst()
    ;
    PureLZMA_Archive_GetArchiveInfo(@ArchiveInfo)
    ; Extract file to exe directory
    PureLZMA_Archive_Extract(GetPathPart(ProgramFilename()) + GetFilePart(ArchiveInfo\FileName))
    ;
    While PureLZMA_Archive_FindNext()  
      ;
      PureLZMA_Archive_GetArchiveInfo(@ArchiveInfo)
      ; Extract file to exe directory
      PureLZMA_Archive_Extract(GetPathPart(ProgramFilename()) + GetFilePart(ArchiveInfo\FileName))
      ;
    Wend
  EndIf
  ;
  PureLZMA_Archive_Close()
EndIf
; Compile as SFX.exe
2. Create the SFX (adds compressed data to the stub) :

Code: Select all

;
; Create SFX
; 
If PureLZMA_Archive_CreateSFX("SFX.exe")
  PureLZMA_Archive_Compress(#PB_Compiler_Home + "Catalogs\Compiler.catalog", #False)
  PureLZMA_Archive_Close()
Else
  MessageRequester("ERRROR", "Could not open SFX stub !", #MB_ICONERROR)
EndIf
3. Execute SFX.exe, it will extract 'Compiler.catalog' to the current directory

Posted: Wed Jan 21, 2009 5:33 pm
by besko
big Tnx Gnozal :)

Posted: Wed Feb 11, 2009 10:48 am
by neotoma
Great Userlib !

Would it be possible to get it as static-Lib + import-Include ?
I have a prob with userlibs, since every new PB-Version change something.
(I hope the include of static-Libs would stay longer.. :-) )

Mike

Posted: Wed Feb 11, 2009 11:50 am
by gnozal
neotoma wrote:I have a prob with userlibs, since every new PB-Version change something.
(I hope the include of static-Libs would stay longer.. :-) )
Imho a MSCOFF static lib [if the PB Compiler would support it] would not last longer (as a userlib is basically a static lib).
I have added a DLL version : http://freenet-homepage.de/gnozal/PureLZMA_DLL.zip

Posted: Fri Feb 13, 2009 1:40 pm
by gnozal
Update (PB4.30 userlib)

Changes
- added PureLZMA-Packer-Mem library in the PureLZMA package.
It allows to read PureLZMA archives included in data sections.

Posted: Fri Feb 13, 2009 5:28 pm
by Fluid Byte
gnozal wrote:- added PureLZMA-Packer-Mem library in the PureLZMA package.
It allows to read PureLZMA archives included in data sections.
You are godlike gnozal! :shock:

Do you want money for that? I would pay! 8)

Posted: Sat Feb 14, 2009 8:56 am
by gnozal
Fluid Byte wrote:You are godlike gnozal! :shock:
There is only one god ...
... srod !

Ok, maybe two with Sparkie.

:D

Posted: Sat Feb 14, 2009 3:23 pm
by Fluid Byte
Both false! It's Fred! :shock:

Posted: Fri Feb 27, 2009 8:14 pm
by AL90
Hello gnozal,

I use following procedure but I got a problem:

Code: Select all

Procedure.l GetCryptedStateLZMA(ArcFile$)

If PureLZMA_Archive_Read(ArcFile$)
  ArchiveInfo.LZMA_ArchiveInfo
  Status = PureLZMA_Archive_FindFirst()
  While Status
    If PureLZMA_Archive_GetArchiveInfo(@ArchiveInfo)
      x = ArchiveInfo\LZMAFlags
      If x = #LZMA_Flag_Crypted
        Break
      EndIf
    EndIf
    Status = PureLZMA_Archive_FindNext()
  Wend
  PureLZMA_Archive_Close()
EndIf

ProcedureReturn x

EndProcedure

debug GetCryptedStateLZMA("D:\Temp\Archive.arc")
If the Archive is crypted, the returned value is '3'. but the doc says
the returned value is '2'. can it be that the doc is wrong ?

Posted: Sat Feb 28, 2009 9:52 am
by gnozal
AL90 wrote:If the Archive is crypted, the returned value is '3'. but the doc says the returned value is '2'. can it be that the doc is wrong ?
I assume the record is packed [#LZMA_Flag_Compressed] and crypted [#LZMA_Flag_Crypted], so flags = #LZMA_Flag_Crypted | #LZMA_Flag_Compressed (= 3 <> #LZMA_Flag_Crypted).
You should test it like this : x & #LZMA_Flag_Crypted.

Posted: Sat Feb 28, 2009 9:06 pm
by AL90
You right. This way will work now. I have so mistake the doc.
Thanks for quoting.

Posted: Mon Aug 17, 2009 12:30 pm
by gnozal
New version compiled with PB4.40 BETA 1 : http://freenet-homepage.de/gnozal/PureLZMA_440.zip

Re: PureLZMA : compress/uncompress data using LZMA algo

Posted: Thu Jan 27, 2011 9:59 pm
by jassing
Is there a way to use a callback for large files to display a progress bar?

Re: PureLZMA : compress/uncompress data using LZMA algo

Posted: Fri Jan 28, 2011 9:04 am
by gnozal
jassing wrote:Is there a way to use a callback for large files to display a progress bar?
No.
PureLZMA uses LzmaCompress() and LzmaUnCompress(), without any streaming features.
I didn't try to use the other LZMA library functions : I'm not very good at C(++).