Page 30 of 40

Posted: Thu Oct 02, 2008 7:27 am
by Frontier
Inner wrote:4.30 beta 2 & 3 of Purebasic reports;

The following PureLibrary is missing: StringExtension
Hi,

All gnozal's libraries expose this error, it has to do with differences in PB 4.30b2. When gnozal recompiles his libraries for PB 4.30b2 (or final) the error will disappear.

Posted: Thu Oct 02, 2008 7:50 am
by DoubleDutch
But will Gnozal be able to compile libs for PureBasic x64?

Posted: Wed Oct 15, 2008 1:53 pm
by Sveinung
Will PureZip be able to compress locked files?

Regards
Sveinung

Posted: Wed Oct 15, 2008 2:36 pm
by GeoTrail
Locked files? As in files that are in use by other programs?

Posted: Wed Oct 15, 2008 3:16 pm
by gnozal
Sveinung wrote:Will PureZip be able to compress locked files?
If PB's function ReadFile() can open your locked files, then probably yes. Otherwise no.

Posted: Mon Nov 03, 2008 1:36 pm
by gnozal
Tip : how to get a ZIP archive comment with PureZIP using ZLIB function unzGetGlobalComment()

Code: Select all

;
; How to get the ZIP archive comment (if any)
;
Import "" ; maybe I add it in the next PureZIP version ....
  unzGetGlobalComment(zipFile.l, *global_comment, CommentBufLen.l) As "_unzGetGlobalComment@12"
EndImport

hZIP = PureZIP_Archive_Read("MyZIP.zip")
If hZIP
  If PureZIP_Archive_GlobalInfo(@GlobalInfo.unz_global_info) = #UNZ_OK
    If GlobalInfo\size_comment
      *Comment = AllocateMemory(GlobalInfo\size_comment)
      If *Comment
        If unzGetGlobalComment(hZIP, *Comment, GlobalInfo\size_comment)
          Debug PeekS(*Comment, GlobalInfo\size_comment) ; <--- archive comment
        EndIf
        FreeMemory(*Comment)
      EndIf
    EndIf
  EndIf
  PureZIP_Archive_Close()
EndIf

Posted: Mon Nov 03, 2008 3:13 pm
by Kiffi
gnozal wrote:Tip : how to get a ZIP archive comment with PureZIP using ZLIB function unzGetGlobalComment()
Thanks a lot! Image

Greetings ... Kiffi

Posted: Wed Nov 19, 2008 3:39 pm
by Inf0Byt3
Gnozal, I have found a fix for that #APPEND_STATUS_CREATEAFTER bug (the one that overwrites the SFX module).

In ZIP.C, in the zipOpen2() function, after this line:

Code: Select all

init_linkedlist(&(ziinit.central_dir));
Add this:

Code: Select all

    if (append == APPEND_STATUS_CREATEAFTER)
    {
      if (ZSEEK(ziinit.z_filefunc,ziinit.filestream,0,ZLIB_FILEFUNC_SEEK_END))
       {
         ZCLOSE(ziinit.z_filefunc,ziinit.filestream);
         return NULL;
       }
    } 
Source:
http://forum.winimage.com/viewtopic.php?p=785&

Posted: Wed Nov 19, 2008 4:22 pm
by gnozal
Inf0Byt3 wrote:Gnozal, I have found a fix for that #APPEND_STATUS_CREATEAFTER bug (the one that overwrites the SFX module).
Thanks.
I knew there was a fix on the forum, but the official package was never updated.
I only used the static library from the ZLIB package, I didn't compile the sources. Unfortunately, I have only (very) little experience with C, so if you (or Fizban [he already compiled a working (with PB) ZLIB static library]) could compile the fixed sources, it would be great.
Anyway, it's still possible to create a SFX : simply copy the ZIP file after the EXE. That's what I do for my library installer.

Posted: Wed Nov 19, 2008 5:49 pm
by Inf0Byt3
Don't have much experience either, but managed to build the new lib. However, please test it well before using. I'm not an expert :(.

I compiled it using the project in \contrib\vstudio\vc8\. When I tested it, it was showing a PB linker error with __time64 or someting like that because PB doesn't know that symbol. To fix it I removed "#include <time.h>" from the source and now VC assumes it's an 'int". The code is included in case you'll need it in the future.

So the modifications are:
1. Fix that bug in Zip.c with append
2. Remove time.h so the lib can be imported without hacks in PB

Download link:

http://purebasic.myftp.org/?filename=fi ... n_v123.zip

Let me know if there are any problems :).
Anyway, it's still possible to create a SFX : simply copy the ZIP file after the EXE. That's what I do for my library installer.
Yup, but this time i wanted to make it work without any temp files :).

Posted: Thu Nov 20, 2008 9:28 am
by gnozal
Thanks.
I made some tests, it seems to work !
I have compiled a test library [PB4.20 ANSI] : http://freenet-homepage.de/gnozal/PureZ ... dFixed.zip
Could you test it carefully to see if something got broken ?

Posted: Thu Nov 20, 2008 1:56 pm
by Inf0Byt3
I've made some tests with it and seems to work with no problems (XP SP3) with all the examples in the manual (from the original PureZip package). It would be great if others would test it as well, just in case.

Posted: Thu Nov 20, 2008 4:12 pm
by gnozal
Update (All PB versions + DLL)

Changes :
- recompiled with a fixed static ZLIB [thanks Inf0Byt3].
It fixes the #APPEND_STATUS_CREATEAFTER issue. The rest should work as usual.

Posted: Tue Dec 02, 2008 5:58 am
by sec
Frontier wrote:
Inner wrote:4.30 beta 2 & 3 of Purebasic reports;

The following PureLibrary is missing: StringExtension
Hi,

All gnozal's libraries expose this error, it has to do with differences in PB 4.30b2. When gnozal recompiles his libraries for PB 4.30b2 (or final) the error will disappear.
Hi gnozal,
Did you fix this error?How fix this error?

Posted: Tue Dec 02, 2008 8:45 am
by gnozal
sec wrote:
Frontier wrote:
Inner wrote:4.30 beta 2 & 3 of Purebasic reports;
The following PureLibrary is missing: StringExtension
Hi,
All gnozal's libraries expose this error, it has to do with differences in PB 4.30b2. When gnozal recompiles his libraries for PB 4.30b2 (or final) the error will disappear.
Hi gnozal,
Did you fix this error?How fix this error?
The libs will be recompiled with PB4.30 final.