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

http://www.purebasic.com
https://www.purebasic.fr/english/
A quick (basic) example :besko wrote:How to write SFX packer with this lib GnozalTnx
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
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..)
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.
There is only one god ...Fluid Byte wrote:You are godlike gnozal!
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")
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 ?
No.jassing wrote:Is there a way to use a callback for large files to display a progress bar?