PureBasic Interface to 7-Zip

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

PureBasic Interface to 7-Zip

Post by JHPJHP »

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

Download PureBasic Interface to 7-Zip from My PureBasic Stuff

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

Announcements
PureBasic Interface to OpenCV
PureBasic Interface to WinDivert
PureBasic Interface to WinRAR
PureBasic Interface to 7-Zip
PureBasic Interface to ImDisk
Windows Services & Other Stuff
Invading Space Aliens
Death Star vs Asteroids
GIF Toolkit
LSB Image Steganography
Spider Web Drawing
Deform Image: MLS
Video Snipping Tool
Chromium Edge WebGadget
IAccessible Interface
Stitch Images: SIFT
OldSkool Fire Effect
Image Waves: LUT
YouTube Player & Downloader
MP4 Player & Downloader
Large Image Viewer
Barcode Generator
Google Translate Service
Embed JS into PureBasic
Geolocation: Google Maps
Book & Viewer & Magnify
Video for Windows: VfW
Alternate Console
Network Share Management

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

INCLUDED
- 12 examples, 4 includes

- SevenZip 9.22.00.02 / 7-Zip 18.5
-- 7-zip32.dll, 7-zip32.lib, 7-zip64.dll, 7-zip64.lib, 7z.exe / 7z.dll / 7z.sfx
-- 7-zip.chm, 7-zip32.h, 7-zip32api.txt, license.txt, websites.txt

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

EXAMPLES
- SevenZip_Add1.pb
-- adds files to an archive (creates the 7z file if needed)
- SevenZip_Add2.pb
-- adds files to an archive (creates the executable 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_Help.pb
-- displays help information in the debug window
- SevenZip_List.pb
-- lists detailed technical information for the files in an archive
- SevenZip_Miscellaneous.pb
-- displays information from a variety of Functions
- 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

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

*** 7z.exe and 7z.dll are not needed for regular use, but have been included to extend the supported formats ***
- 7z.sfx supresses the SFX dialog box from showing; demonstrated in the example: SevenZip_Add2.pb
Last edited by JHPJHP on Sat Oct 16, 2021 8:52 pm, edited 131 times in total.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
User avatar
JHPJHP
Addict
Addict
Posts: 1851
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.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
User avatar
Kwai chang caine
Addict
Addict
Posts: 4968
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
User avatar
JHPJHP
Addict
Addict
Posts: 1851
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

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
PureGuy
Enthusiast
Enthusiast
Posts: 101
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.
User avatar
JHPJHP
Addict
Addict
Posts: 1851
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.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
User avatar
JHPJHP
Addict
Addict
Posts: 1851
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.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
RASHAD
PureBasic Expert
PureBasic Expert
Posts: 4107
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
User avatar
JHPJHP
Addict
Addict
Posts: 1851
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

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
Poshu
Enthusiast
Enthusiast
Posts: 460
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!
User avatar
JHPJHP
Addict
Addict
Posts: 1851
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.

STATUS: Mostly Unavailable :: Downloads moved to My PureBasic Stuff; free executables, access key required for source code.
_________________
Post Reply