Page 1 of 1

PackerEx_Include (extended PB pack functions)

Posted: Sun Jan 30, 2005 4:23 am
by Mischa
It's a long time ago, i've been working at last with PB pack functions.

With this include you can create archives, file dates, 0 byte files and empty
directories inclusive.
You can add and remove items and you can append archives to executables
or any other files. The appended archives will be editable all the time.
Standalones and such thing will be no problem.

Functions:
AddEmptyDirectoryToPack
AddFileToPack
AddFullDirectoryToPack
AppendFilePack
CloseFilePack
CreateFilePack
DeleteFileInPack
ExtractPack
ExtractPackFile
ExtractPackFileToMem
FindPackFile
OpenFilePack
I've written a simple gui example and a little help file, too.

It's not perfect, but maybe helpful for someone.
(But maybe it's not the right stuff for PB rookies)

Download: http://www.thinkrelative.de/packerex.zip

Regards,
Mischa

Posted: Sun Jan 30, 2005 4:33 am
by Shannara
This is sweet, if you could get password functionality and ability to get the packed file size (after packed), and compression, this would rival vBin :)

Posted: Wed Feb 16, 2005 12:49 pm
by Mischa
Update.
This is sweet, if you could get password functionality and ability to get the packed file size (after packed), and compression
Done.

->DOWNLOAD

Please test it.

Regards,
Mischa

Posted: Wed Feb 16, 2005 2:44 pm
by blueb
Mischa,

I downloaded and started testing your Packer functions. Seems very good so far.

I wanted to thank you for the include file and the source code to Packer.exe

I like looking at other developer's code, because I always learn many new tricks.

Thanks again :D
--blueb

Posted: Thu Feb 17, 2005 10:55 am
by Num3
ImageImageImageImageImage

Posted: Mon Aug 22, 2005 1:04 am
by Shannara
Do you have an example of using this against an EXE file? CreatePackFile doesnt work on those, but OpenFilePak does, however it gives errors whenever trying to add something:

Code: Select all

refkey.s=PeekS(*phrase)
Invalid memory access.

Posted: Mon Feb 20, 2006 3:20 am
by Shannara
I would like to update this to 4.0, and post the updated code or PM it to you, if you like?

Posted: Mon Feb 20, 2006 1:59 pm
by Thorsten1867
Shannara wrote:I would like to update this to 4.0, and post the updated code or PM it to you, if you like?
That would be great! I need the update for converting my program to PB V4.

Posted: Tue Feb 21, 2006 6:16 am
by Mischa
This would be nice @Shannara
Thanks for your help.


Regards,
Mischa[/url]

Posted: Wed Mar 01, 2006 2:37 am
by mskuma
Mischa, thanks for making this available. Is it possible to update the release for PB4? Thanks.

Posted: Thu Jun 01, 2006 8:03 am
by Thorsten1867
I've converted it to PB4 and send it to Mischa.

I could make it availible, if Mischa allows it.

Posted: Thu Jun 01, 2006 9:29 am
by Mischa
@Thorsten
You've send it? Can't find it here. :oops:

and of course you are allowed to making it avaible.

Regards,
Mischa

Posted: Thu Jun 01, 2006 1:02 pm
by Thorsten1867

Posted: Thu Aug 24, 2006 9:27 am
by mskuma
Thanks Mischa & Thorsten1867 - this is an interesting lib for me. I've been trialling this v4 lib for a project, and I found a subtle issue (bug?) in FindPackFile().

Here's my situation. I have a pack file of containing a lot of images - e.g. in this order (most are omitted, what is shown are the important ones for this issue) -
quit-dn.png
.
.
t-dn.png
When I was trying to find 'T-dn.png' using:

Code: Select all

packID = FindPackFile("T-dn.png",0) 
I was always getting the 'quit-dn.png' id returned. Looking at the FindPackFile code, I could understand why (the FindString would pass for the case of 't-dn.png' & 'quit-dn.png' since both have the same substring). To fix this I changed the FindPackFile code from:

Code: Select all

Procedure FindPackFile(name.s,startid)
  element=SelectElement(PackItem(),startid)
  filefound=-1
  While element And filefound=-1
    If FindString(LCase(PackItem()\name),LCase(name),1)
      filefound=ListIndex(PackItem())
    EndIf
    element=NextElement(PackItem())
  Wend
  ProcedureReturn filefound
EndProcedure
to

Code: Select all

Procedure FindPackFile(name.s,startid)
  element=SelectElement(PackItem(),startid)
  filefound=-1
  While element And filefound=-1
    If FindString(LCase(PackItem()\name),LCase(name),1) = 1
      filefound=ListIndex(PackItem())
    EndIf
    element=NextElement(PackItem())
  Wend
  ProcedureReturn filefound
EndProcedure
which works for me. Not sure if that was the best solution (or if I used the function correctly - in that case, please let me know). I report this just in case someone else comes across this issue. Thanks again.

Re:

Posted: Tue Jun 05, 2018 3:46 pm
by Kuron
Does anybody still have this or the last version posted by Mischa?