Page 11 of 40
Posted: Sat Jul 22, 2006 7:38 am
by gnozal
Kiffi wrote:gnozal wrote:Could you try it ?
sorry, same behaviour as before: PureZIP_ExtractFiles returns #Null and the
uncompressed filesize is negative.
Greetings ... Kiffi
Well, it seems to be a LONG -> QUAD conversion problem ...
Code: Select all
Structure test
TESTL.l
TESTQ.q
EndStructure
t.test\TESTL = 2500000000
t.test\TESTQ = 2500000000
Size.q = t\TESTL
Debug Size ; -1794967296 !!!
Size = t\TESTQ
Debug Size ; 2500000000
it works like this :
BETA lib updated, please try again (sorry).
http://people.freenet.de/gnozal/PureZIP_BETA.zip
Posted: Sat Jul 22, 2006 2:18 pm
by Kiffi
>
BETA lib updated
well done, gnozal! Now i can extract the file. And the progress value in the
Callback works also.
Unfortunately the FileInfo i receive with PureZIP_Archive_FileInfo() contains a
negative uncompressed filesize. But i'am sure, that you will get it.
Greetings ... Kiffi
Posted: Sun Jul 23, 2006 7:55 pm
by zikitrake

is this a bug... or I'm a bigbug???:
I've a file (TEST-TIME.TXT) with modified date: 23/06/2006 20:53:11
When I view modified date in TEST-TIME.TXT in the zipped file, it lost a second.
Code: Select all
myFileinfo.PureZIP_FileInfo
MyZIP.s = "C:\test.zip"
MyFilesToZIP.s = "C:\TEST\test-time.txt"
Debug PureZIP_AddFiles(MyZIP, MyFilesToZIP, #PureZIP_StorePathAbsolute, #PureZIP_Recursive)
It
only occurs with some hours, any help?
Really thank you, Gnozal!
... and sorry for my bad (fatal) english
Posted: Mon Jul 24, 2006 7:24 am
by gnozal
Kiffi wrote:>
BETA lib updated
well done, gnozal! Now i can extract the file. And the progress value in the
Callback works also.
Unfortunately the FileInfo i receive with PureZIP_Archive_FileInfo() contains a
negative uncompressed filesize. But i'am sure, that you will get it.
Greetings ... Kiffi
The FileInfo structure has longs, as it is a ZLIB based structure. You will have to do a correction like : FileSize.q = FileInfo\unCompressedSize & $FFFFFFFF. I will add this in the manual.
Posted: Mon Jul 24, 2006 7:30 am
by gnozal
zikitrake wrote:I've a file (TEST-TIME.TXT) with modified date: 23/06/2006 20:53:11
It only occurs with some hours, any help?
I am afraid not.
I only fill a structure for ZLIB :
Code: Select all
Procedure FileTimeToDate(*FT.FILETIME)
FileTimeToLocalFileTime_(*FT.FILETIME,FT2.FILETIME)
FileTimeToSystemTime_(FT2,st.SYSTEMTIME)
ProcedureReturn Date(st\wYear,st\wMonth,st\wDay,st\wHour,st\wMinute,st\wSecond)
EndProcedure
Procedure LIB_GetFileDate(File.s)
result=0
Handle=CreateFile_(@File,#GENERIC_READ,#FILE_SHARE_READ|#FILE_SHARE_WRITE,0,#OPEN_EXISTING,#FILE_ATTRIBUTE_NORMAL,0)
If Handle<>#INVALID_HANDLE_VALUE
GetFileTime_(Handle,0,0,FT.FILETIME)
result=FileTimeToDate(FT)
CloseHandle_(Handle)
EndIf
ProcedureReturn result
EndProcedure
; ////// Store file date into zfi.zip_file_info
FileDate = LIB_GetFileDate(FileName)
zfi\tm_zip\tm_sec = Val(FormatDate("%ss", FileDate))
zfi\tm_zip\tm_min = Val(FormatDate("%ii", FileDate))
zfi\tm_zip\tm_hour = Val(FormatDate("%hh", FileDate))
zfi\tm_zip\tm_mday = Val(FormatDate("%dd", FileDate))
zfi\tm_zip\tm_mon = Val(FormatDate("%mm", FileDate)) - 1
zfi\tm_zip\tm_year = Val(FormatDate("%yyyy", FileDate))
; //////
Posted: Mon Jul 24, 2006 8:52 am
by gnozal
Update (
PB4.00 version only)
Changes :
- PureZIP now supports files up to 4 GB size.
Note
ZLIB can handle files up to 4 Gbytes, but PB longs are signed [0 - 2 Gbytes]...
So if you expect PureZIP_FileInfo\CompressedSize > 2 Gbytes or PureZIP_FileInfo\unCompressedSize > 2 Gbytes,
use quads and convert signed to unsigned !
Example : Size.q = FileInfo\unCompressedSize & $FFFFFFFF
Download : http://people.freenet.de/gnozal/PureZIP_.zip
Posted: Mon Jul 24, 2006 7:41 pm
by Thorsten1867
If I try to append a zip to my executable, the executable is killed and no longer works (zip is ok). I don't know, what's the error.
Code: Select all
If PureZIP_Archive_Create(OutputDir$+Exe$, #APPEND_STATUS_CREATEAFTER)
If ExamineDirectory(0, Dir$, "*.*")
While NextDirectoryEntry(0)
If DirectoryEntryType(0) = #PB_DirectoryEntry_File
PureZIP_Archive_Compress(Dir$+"\"+DirectoryEntryName(0), #False)
EndIf
Wend
FinishDirectory(0)
EndIf
PureZIP_Archive_Close()
EndIf
Posted: Tue Jul 25, 2006 9:22 am
by gnozal
Thorsten1867 wrote:If I try to append a zip to my executable, the executable is killed and no longer works (zip is ok). I don't know, what's the error.
Yes, I noticed. I don't know what the problem is with #APPEND_STATUS_CREATEAFTER.
What I do : I simply copy the final ZIP at the end of the executable and it works.
Posted: Tue Jul 25, 2006 2:15 pm
by Thorsten1867
gnozal wrote:What I do : I simply copy the final ZIP at the end of the executable and it works.
That's the code I need. How can I do this? I've no idea how two join to files.
Posted: Tue Jul 25, 2006 2:31 pm
by Kiffi
gnozal wrote:Changes :
- PureZIP now supports files up to 4 GB size.
Wonderful, now it works!
Three cheers for gnozal!
Thanks & Greetings ... Kiffi
Posted: Tue Jul 25, 2006 2:54 pm
by ts-soft
Thorsten1867 wrote:gnozal wrote:What I do : I simply copy the final ZIP at the end of the executable and it works.
That's the code I need. How can I do this? I've no idea how two join to files.
Code: Select all
Procedure LinkToExe(ExeFile.s, ZipFile.s)
Protected File.l, Pack.l, Size.l, Mem.l
File = OpenFile(#PB_Any, ExeFile)
If File
Pack = ReadFile(#PB_Any, ZipFile)
Size = Lof(Pack)
Mem = AllocateMemory(Size)
If Mem
ReadData(Pack, Mem, Size)
CloseFile(Pack)
FileSeek(File, Lof(File))
WriteData(File, Mem, Size)
CloseFile(File)
FreeMemory(Mem)
ProcedureReturn #True
EndIf
EndIf
ProcedureReturn #False
EndProcedure
Posted: Fri Aug 04, 2006 8:53 pm
by dracflamloc
Thanks for this lib =)
Posted: Sun Aug 06, 2006 5:56 pm
by Inf0Byt3
Gnozal, PureZIP opens a SFX module only if the data is appended at the end? I ask you this because was trying to find a solution to have inside a settings file too... How does your library installer work? As i've seen, it doesn't create any temporary files

.
Posted: Mon Aug 07, 2006 8:03 am
by gnozal
Inf0Byt3 wrote:As i've seen, it doesn't create any temporary files

.
I add the installer information in a file in the ZIP (in my installer it's "File_Id.Diz"). This file is not extracted but the installer reads its content with PureZIP_Archive_ExtractMem().
Download
http://people.freenet.de/gnozal/PureLVSORT_.zip and open PureLVSORT-Installer.exe in WInRAR or any other archiver : you will see the "File_Id.Diz" at the root of the archive.
Posted: Mon Aug 07, 2006 9:30 am
by Inf0Byt3
Oh... I see... Thanks for the tip

... I had a hunch about this but I was unsure about it

.