PureBasic Interface to 7-Zip

Share your advanced PureBasic knowledge/code with the community.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to SevenZip

Post by JHPJHP »

After reading the following post, I searched for newer 32/64bit libraries that supported LZMA2: http://www.purebasic.fr/english/viewtop ... 77#p460177
- not tested, but documentation suggests that the newer libraries support the compression method

Information:
- Command Line Commands
- Command Line Switches

---------------------------------------------------------------------------

Updated:
- added 9 examples
-- SevenZip_Add.pb : adds files to an archive (creates the 7z file if needed)
-- SevenZip_Delete.pb: deletes files from an archive
-- SevenZip_Extract1.pb: extracts the contents of an archive including folders
-- SevenZip_Extract2.pb: extracts the contents of an archive excluding folders
-- SevenZip_List.pb: lists detailed technical information for the files in an archive
-- SevenZip_Password.pb: adds password protected files to an archive (creates the 7z file if needed)
-- SevenZip_Test.pb: test the integrity of files in an archive
-- SevenZip_Update.pb: updates files in an archive without needing to decompress and recompress the entire archive (creates the 7z file if needed)
-- SevenZipOpenArchive.pb: displays a list of folder/files contained within an archive
- added 1 test file: 7z938-extra.7z
Last edited by JHPJHP on Sun Feb 01, 2015 2:17 pm, edited 4 times in total.
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5342
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: PureBasic Interface to SevenZip

Post by Kwai chang caine »

Again a great project of JHPJHP :shock:
Thanks a lot for all the works you sharing with us 8)
ImageThe happiness is a road...
Not a destination
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to SevenZip

Post by JHPJHP »

Hi Kwai chang caine,

Thank you for your kind words.

-------------------------------------------------

Updated:
- added 1 example
-- SevenZip_Miscellaneous.pb: displays information from a variety of Functions

-------------------------------------------------

Updated the example: SevenZip_Miscellaneous.pb.
- formatted the information to be more readable, includes various date/time conversions
PureGuy
Enthusiast
Enthusiast
Posts: 102
Joined: Mon Aug 30, 2010 11:51 am

Re: PureBasic Interface to SevenZip

Post by PureGuy »

Great work JHPJHP :D
Thanks a lot for that update and all the nice examples.

"IncludeFile" do not work with PB5.24, due to the change made in PB5.30.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to SevenZip

Post by JHPJHP »

Hi PureGuy,

Thank you for your comments, and for pointing out the issue with the Include files.

--------------------------------------------------------------------

Updated:
- fix the issue with the Include files, should now run in PureBasic 5.24 LTS (x86 / x64)

NB*: Made other small changes, nothing worth documenting.

--------------------------------------------------------------------

Updated:
- renamed 1 example
-- SevenZip_Add.pb to SevenZip_Add1.pb
- added 2 examples
-- SevenZip_Add2.pb: adds files to an archive (creates the executable if needed)
-- SevenZip_Help.pb: displays help information in the debug window
- added 1 binary
-- 7z.sfx (x86 / x64)
- added 1 reference
-- 7-zip.chm

I was testing the [a]dd parameter with the -sfx switch used to create a self-extracting executable, but it kept opening a dialog box first. After some research I found that the use of an sfx file allows for control/suppression of the dialog: SevenZip_Add2.pb.

I've also added the -hide switch to the examples, supressing the 7-zip information window from showing; debug window will display the returned information.
Last edited by JHPJHP on Sun Feb 01, 2015 10:18 am, edited 1 time in total.
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to SevenZip

Post by JHPJHP »

Updated:
- added 1 include: procedures.pbi
- added 2 binaries: 7z.exe, 7z.dll (x86 / x64)
- added 1 test file: 7-ZipPortable.exe

*** 7z.exe and 7z.dll are not needed for regular use, but have been included to extend the supported formats ***

In this post I stated that the Z-zip command line tool did not support Packed executables. While this is true, the main executable combined with it's DLL can be run from a command prompt, extending support.

I've created a simple RunProgram Procedure that will execute the desired command if the previous call to the Interface fails.
- most examples have been modified to the new format; update also includes various improvements

-------------------------------------------------------------------

Some important updates have been applied to the Interface allowing for more user control, including some bug fixes.
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4635
Joined: Sun Apr 12, 2009 6:27 am

Re: PureBasic Interface to SevenZip

Post by RASHAD »

You are doing a very good job for the forum JHPJHP
I mean it for all your stuff
Thanks
Egypt my love
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to SevenZip

Post by JHPJHP »

Hi RASHAD,

You're welcome, and thank you for commenting; my respect for all the help you provide this forum as well.

Cheers!

-----------------------------------------------------------

Updated:
- applied a couple small improvements
- applied changes that gives the user more control
- fixed a problem with a few date settings

-----------------------------------------------------------

Updated:
- SevenZip_Password.pb: modified from multi-file selection to folder selection
- SevenZip_Update.pb: modified to allow the selecting of an existing archive
Poshu
Enthusiast
Enthusiast
Posts: 459
Joined: Tue Jan 25, 2005 7:01 pm
Location: Canada

Re: PureBasic Interface to SevenZip (7-zip)

Post by Poshu »

This could become handy, thanks!
JHPJHP
Addict
Addict
Posts: 2129
Joined: Sat Oct 09, 2010 3:47 am
Contact:

Re: PureBasic Interface to 7-Zip

Post by JHPJHP »

Hi Poshu,

You're welcome, I hope it can be of some use.

---------------------------------------

Updated:
- latest binaries (2018-12-11)

NB*: I did not do must testing, please let me know of any issues.
Locked