Recent

Author Topic: 7zip Delphi-Wrapper  (Read 16498 times)

uwetr

  • Newbie
  • Posts: 2
7zip Delphi-Wrapper
« on: June 18, 2015, 01:33:13 pm »
Hi,

I would like to extract some 7zip Archives by using Lazarus

So I've found a Delphi-Wrapper for the 7z-dll at https://code.google.com/p/d7zip/downloads/list

But I'm a newbie in Lazarus, so I have no idea if/how to use it with Lazarus. ;-(

Could someone give me hand in how to start ?

thanks in advance and best regards,
  Uwe


Viele Grüße,
Uwe

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: 7zip Delphi-Wrapper
« Reply #1 on: June 18, 2015, 01:51:45 pm »
But I'm a newbie in Lazarus, so I have no idea if/how to use it with Lazarus. ;-(

Could someone give me hand in how to start ?
Forget this 7zip thing, get the basics working in your brain first. Read the documentation & wiki, look for tutorials on the net. The unit compiles cleanly for windows target using delphi mode.
« Last Edit: June 18, 2015, 10:04:04 pm by Leledumbo »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4474
  • I like bugs.
Re: 7zip Delphi-Wrapper
« Reply #2 on: June 18, 2015, 02:21:12 pm »
The component uses ActiveX and is Windows dependent.
I found another component, "Delphi TSevenZipVCL" in page :
  http://www.rg-software.de/
It uses a DLL. It would be possible to make a cross-platform version that uses 7z.so on Unix related systems and 7za.dll on Windows. Such component could be added to CCR.
If somebody is interested to implement it, please look at the BZip2 component as an example :
  http://wiki.lazarus.freepascal.org/bzip2lib
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: 7zip Delphi-Wrapper
« Reply #3 on: June 18, 2015, 10:13:06 pm »
The component uses ActiveX and is Windows dependent.
I found another component, "Delphi TSevenZipVCL" in page :
  http://www.rg-software.de/
It uses a DLL. It would be possible to make a cross-platform version that uses 7z.so on Unix related systems and 7za.dll on Windows. Such component could be added to CCR.
It uses activex as well. I think it's better to grab current 7-zip C source then convert the header to Pascal unit instead. It should be free from windows-ism.

Michl

  • Full Member
  • ***
  • Posts: 226
Re: 7zip Delphi-Wrapper
« Reply #4 on: June 18, 2015, 10:31:21 pm »
There is a crosspost to German Lazarusforum.

Just as a note, the Delphi wrapper
So I've found a Delphi-Wrapper for the 7z-dll at https://code.google.com/p/d7zip/downloads/list
works also in Lazarus on Windows 7, with $MODE DELPHI and a removed " (* " in the unit.
Code: [Select]
type
  TLiveSelection = (lsMoney, lsChilds, lsTime);
  TLive = Array[0..1] of TLiveSelection;

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: 7zip Delphi-Wrapper
« Reply #5 on: June 18, 2015, 11:02:32 pm »
There is a crosspost to German Lazarusforum.

Just as a note, the Delphi wrapper
So I've found a Delphi-Wrapper for the 7z-dll at https://code.google.com/p/d7zip/downloads/list
works also in Lazarus on Windows 7, with $MODE DELPHI and a removed " (* " in the unit.
open source Inno setup uses 7z to compress the files in the setup I don't remember if it is 7z format it self or only lzma though. Peazip an open source multi compression utility supports it I don't remember if it requires the dll in any case the 7z file format is on some sort of gpl so it shouldn't be used on none gpl applications I think.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

uwetr

  • Newbie
  • Posts: 2
solved:7zip Delphi-Wrapper
« Reply #6 on: June 19, 2015, 12:23:48 am »
Hi,

thanks to all for the helping hands!
@Michl: working perfekt, thank you so much!

cheers, 
  Uwe


avra

  • Hero Member
  • *****
  • Posts: 2514
    • Additional info
Re: 7zip Delphi-Wrapper
« Reply #7 on: June 19, 2015, 08:58:55 am »
I think it's better to grab current 7-zip C source then convert the header to Pascal unit instead.
For the record, I have found partial conversion in CodeTyphon. So far just LZMA works.
http://www.pilotlogic.com/sitejoom/index.php/forum/32-codeocean/3186-7zip-pascal-native-support
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: 7zip Delphi-Wrapper
« Reply #8 on: June 19, 2015, 11:01:11 am »
For the record, I have found partial conversion in CodeTyphon. So far just LZMA works.
http://www.pilotlogic.com/sitejoom/index.php/forum/32-codeocean/3186-7zip-pascal-native-support
http://www.birtles.org.uk/programming/  this is the sdk translation of 7z to pascal this has been converted because the sdk is released under public domain the 7z file format is under a different license not commercial friendly if I remember correctly thats why it has not been converted.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11459
  • FPC developer.
Re: 7zip Delphi-Wrapper
« Reply #9 on: June 19, 2015, 01:10:57 pm »
http://www.birtles.org.uk/programming/  this is the sdk translation of 7z to pascal this has been converted because the sdk is released under public domain the 7z file format is under a different license not commercial friendly if I remember correctly thats why it has not been converted.

(7z dll is LGPL+ some extra restrictions on the unrar code. I assume the unrar code could be removed, so that would leave pure LGPL.  That means you must deliver it in a dll/.so and make the changes available on request. Not really anti-commercial, but it does prohibit static linking it under normal conditions)

 

TinyPortal © 2005-2018