It is currently Thu Jun 20, 2013 2:33 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: 7-zip32.dll wrapper
PostPosted: Wed Mar 28, 2007 2:20 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4740
Location: Berlin - Germany
This is a IncludeFile for 7-zip32.dll using static lib.

Unfortunately, I haven't found documentation (except in Japanese), but I
hope so, it's also useful

The folder-structure corresponds in the IncludePack used, 7-zip32.dll is in the
compilers subdirectory.
http://www.purebasic.fr/english/viewtop ... ncludepack

Example:
Code:
XIncludeFile #PB_Compiler_Home + "Includes\7-zip32_Include.pbi"

Define.l HARC = SevenZipOpenArchive(0, #PB_Compiler_Home + "Includes\Libraries\sourcen\7-zip32.7z", #ARCEXTRACT_OPEN)
Define.INDIVIDUALINFO INFO

If HARC

  If Not SevenZipFindFirst.l(HARC, "*.*", @INFO)
    Debug INFO\szFileName

    While Not SevenZipFindNext(HARC, @INFO)
   
      Debug INFO\szFileName
     
    Wend
  EndIf
  SevenZipCloseArchive.l(HARC)
EndIf

The Not is the same as = 0 :wink:

Download 336kb

Feedback and Bug-Reports welcome

Greetings
Thomas

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Linux Mint 15 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 5:11 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jun 30, 2006 4:30 pm
Posts: 567
Location: NDIA Project
Thanks. I might need this. :D


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 5:56 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4740
Location: Berlin - Germany
@JCV
You are welcome :D

Another small example to pack as 7z

Code:
XIncludeFile #PB_Compiler_Home + "Includes\7-zip32_Include.pbi"

; this small programm makes a backup of purebasic with all subdirectories and files
; in the tempdir as 7z

Procedure BackUpPB()
  Protected Output.s = Space(255)
  Protected Destination.s = #DQUOTE$ + GetTemporaryDirectory() + "purebasic_bak" + #DQUOTE$
  Protected CmdLine$ =  "a -t7z -mx7 -ir!*.* " + Destination + " " + #DQUOTE$ + "*.*" + #DQUOTE$
  SetCurrentDirectory(#PB_Compiler_Home)
  If SevenZip(WindowID(0), CmdLine$, Output, 255) = 0
    ProcedureReturn #True
  EndIf
  Debug Output
  ProcedureReturn #False
EndProcedure

If OpenWindow(0, 0, 0, 140, 60, "PureBasic Backup", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
  If CreateGadgetList(WindowID(0))
    ButtonGadget(0, 30, 20, 80, 30, "Make Backup")
    Repeat
      Select WaitWindowEvent()
        Case #PB_Event_CloseWindow
          Break
        Case #PB_Event_Gadget
          If EventGadget() = 0
            If BackUpPB()
              RunProgram("explorer.exe", "/e," + GetTemporaryDirectory(), ""); show the result
            EndIf
            Break
          EndIf
      EndSelect
    ForEver
  EndIf
EndIf

The Syntax is nearly the same as for the commandline-version of 7-Zip

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Linux Mint 15 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 7:33 am 
Offline
Addict
Addict
User avatar

Joined: Wed Jun 11, 2003 9:33 pm
Posts: 4008
Location: Spa, relaxing and thinking, and thinking...
Thanks, i was waiting for 7z to be available for management with PB :)

_________________
http://www.nietzscheana.com.ar
http://www.zeitgeistmovie.com


for (humanlife=0 ; world==business ; humanlife++)
{
mafia+=world;
}


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 12:11 pm 
Offline
PureBasic Fanatic
PureBasic Fanatic
User avatar

Joined: Fri Dec 09, 2005 12:15 pm
Posts: 2187
Location: RO, the land of all possibilities
OMG! :shock: . ts-soft, I love you man! Thanks!

[Edit]
Can this be used in a commercial project? :?

_________________
I hear and I forget. I see and I remember. I do and I understand. (Confucius)

Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 2:44 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4740
Location: Berlin - Germany
Inf0Byt3 wrote:
Can this be used in a commercial project? :?

Is the same license as 7zip, LGPL, see copying.txt!
You can use in commercial projects!

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Linux Mint 15 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 3:12 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4740
Location: Berlin - Germany
Only one line changed to create a sfx-installer with passwort :wink:
Code:
XIncludeFile #PB_Compiler_Home + "Includes\7-zip32_Include.pbi"

Procedure CreatePBSetup()
  Protected Output.s = Space(255)
  Protected Destination.s = #DQUOTE$ + GetTemporaryDirectory() + "purebasic_setup" + #DQUOTE$
  Protected CmdLine$ =  "a -sfx -mx7 -p -ir!*.* " + Destination + " " + #DQUOTE$ + "*.*" + #DQUOTE$
  SetCurrentDirectory(#PB_Compiler_Home)
  If SevenZip(WindowID(0), CmdLine$, Output, 255) = 0
    ProcedureReturn #True
  EndIf
  Debug Output
  ProcedureReturn #False
EndProcedure

If OpenWindow(0, 0, 0, 140, 60, "PureBasic Setup", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
  If CreateGadgetList(WindowID(0))
    ButtonGadget(0, 30, 20, 80, 30, "Make Setup")
    Repeat
      Select WaitWindowEvent()
        Case #PB_Event_CloseWindow
          Break
        Case #PB_Event_Gadget
          If EventGadget() = 0
            If CreatePBSetup()
              RunProgram("explorer.exe", "/e," + GetTemporaryDirectory(), ""); show the result
            EndIf
            Break
          EndIf
      EndSelect
    ForEver
  EndIf
EndIf

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Linux Mint 15 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 7:40 pm 
Offline
PureBasic Fanatic
PureBasic Fanatic
User avatar

Joined: Fri Dec 09, 2005 12:15 pm
Posts: 2187
Location: RO, the land of all possibilities
This is awesome! Been waiting for a very long time for this. Thank you for your efforts!

_________________
I hear and I forget. I see and I remember. I do and I understand. (Confucius)

Image


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 28, 2007 8:08 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4740
Location: Berlin - Germany
I have found an english API-Description:
http://www.csdinc.co.jp/archiver/lib/7-zip32api-en.txt

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Linux Mint 15 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 6:16 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4740
Location: Berlin - Germany
Small Update for unicode compatible

Changed some stringparameter to pseudotype ASCII
Some parameter as optional declared
In structures all strings as character defined! Read it with peeks!

_________________
PureBasic 5.11 | Windows 7 SP1 (x64) | Linux Mint 15 (x64) | RealSource

The use of EnableExplicit is free of charge and avoids errors.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 16, 2007 12:47 pm 
Offline
User
User

Joined: Tue Apr 26, 2005 9:55 am
Posts: 28
nice on Ts-Soft. Have you thought about putting this code and examples in your excellent PBOSL library?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 16, 2007 3:25 pm 
Offline
Addict
Addict

Joined: Mon May 29, 2006 1:01 am
Posts: 1966
Location: Outback
ts-soft wrote:
Unix is user friendly... it's just selective about who its friends are!


lol. :D

Thanks for the 7-zip!

_________________
Dare2 cut down to size


Top
 Profile  
 
 Post subject: Re: 7-zip32.dll wrapper
PostPosted: Tue Jun 01, 2010 2:39 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Apr 30, 2003 8:15 am
Posts: 720
Location: Germany
is this project sill activ? the dl link is broken...

_________________
"Daddy, I'll run faster, then it is not so far..."


Top
 Profile  
 
 Post subject: Re: 7-zip32.dll wrapper
PostPosted: Tue Jun 01, 2010 3:55 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 24, 2004 2:44 pm
Posts: 4740
Location: Berlin - Germany
dige wrote:
is this project sill activ?
No
dige wrote:
the dl link is broken...

I think the DLL comes with PureFileMaster by Al90, or use the commandline-interface from 7zG.exe,
is easy to use.


Top
 Profile  
 
 Post subject: Re: 7-zip32.dll wrapper
PostPosted: Wed Jun 02, 2010 7:31 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Apr 30, 2003 8:15 am
Posts: 720
Location: Germany
Could you pls put the old sources available again?

_________________
"Daddy, I'll run faster, then it is not so far..."


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 28 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye