PureLZMA : compress/uncompress data using LZMA algo
Moderator: gnozal
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
A quick (basic) example :besko wrote:How to write SFX packer with this lib Gnozal Tnx
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
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
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Imho a MSCOFF static lib [if the PB Compiler would support it] would not last longer (as a userlib is basically a static lib).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.. )
I have added a DLL version : http://freenet-homepage.de/gnozal/PureLZMA_DLL.zip
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Update (PB4.30 userlib)
Changes
- added PureLZMA-Packer-Mem library in the PureLZMA package.
It allows to read PureLZMA archives included in data sections.
Changes
- added PureLZMA-Packer-Mem library in the PureLZMA package.
It allows to read PureLZMA archives included in data sections.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
You are godlike gnozal!gnozal wrote:- added PureLZMA-Packer-Mem library in the PureLZMA package.
It allows to read PureLZMA archives included in data sections.
Do you want money for that? I would pay!
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Hello gnozal,
I use following procedure but I got a problem:
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 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")
the returned value is '2'. can it be that the doc is wrong ?
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
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).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 ?
You should test it like this : x & #LZMA_Flag_Crypted.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
New version compiled with PB4.40 BETA 1 : http://freenet-homepage.de/gnozal/PureLZMA_440.zip
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: PureLZMA : compress/uncompress data using LZMA algo
Is there a way to use a callback for large files to display a progress bar?
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: PureLZMA : compress/uncompress data using LZMA algo
No.jassing wrote:Is there a way to use a callback for large files to display a progress bar?
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(++).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).