Solved

Using Winzip in delphi

Posted on 2001-08-30
8
1,049 Views
Last Modified: 2012-08-14
I would like to use winzip in delphi?

The purpose is to zip a set of files using winzip.

How to acheive this?



0
Comment
Question by:vensan
8 Comments
 
LVL 2

Expert Comment

by:aubs
ID: 6439898
I seem to remember seeing a zip component at www.torry.net

i will try to get a more accurate URL later

regards

Aubs
0
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 100 total points
ID: 6439900
Hello
 

  Look at this link you will find many components to compress and uncompress files using zip format and others

http://www.torry.net/compressstd.htm
also look at "Delphi Zip Beta Page" for free zip and uzip dll for delphi, it come with good samples
http://www.geocities.com/SiliconValley/Network/2114/zipbeta.html

Best regards
Mohammed
0
 
LVL 6

Expert Comment

by:Jaymol
ID: 6439907
I think you're getting away from the point.  He's asking how to use WinZip.

John.
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
LVL 6

Expert Comment

by:Stuart_Johnson
ID: 6440271
Does WinZip have an interface that you can connect too?  I'm not sure if it does.  You maybe stuck using third party controls, or run WinZip from a ShellExecute statement and have the window hidden while you do the work.  This option wont give you any real interaction with WinZip though.

I dont use WinZip (I use WinACE), so I can't test it, but if you open Delphi and go to the Project menu, then Import Type Library, click the Add button and navigate to the WinZip folder (usually C:\Program Files\WinZip), double click on the winzip.exe file, if it has a COM interface, this will give you a Pas file with all the exposed methods.

I would be very surprised if it does, but you can never tell unless you try ;)

Let me know if it does work and I'll download a copy for myself to play with :)

Cheers

Stu
0
 

Assisted Solution

by:thornolde
thornolde earned 100 total points
ID: 6440637
You ca call the commandline part of winzip (WZunzip, WZzip). I don't remember if they are included in the standard package, but you can download these for free at the winzip site.

I've included a code snippet to show how I used them to unzip (just WSzip if you want to zip something)

procedure TUpdate_MainFrm.UnpackUpdate(ZipFile:String);
var
//  Returnvalue   : integer;
  ZipFileName, Zparam, defaultdir : String;
Begin
  ZipFileName := getPath(pCurrent)+'\WZUnzip.exe ';
  Zparam := '-d -o ' + getPath(pTemp)+ZipFile;
  defaultdir := getPath(pTemp);
  // This method will try to open an file/url.
  // Eg.:
  //  zipfilename="mailto:lectrn@lec.dk" starts users e-mail cllient (eg. Lotus Notes)
  //  zipfilename="readme.txt" starts users texteditor (eg. notepad.exe)
  //  zipfilename="some.exe" starts program "some.exe".
  WriteLn(LogFile, 'Unpacking ' + Zparam);
//  ReturnValue := ShellExecute(Update_MainFrm.Handle, 'open', PChar(ZipFileName), PChar(Zparam), PChar(defaultdir), SW_HIDE);
  SetCurrentDir(getPath(pTemp));
  ExecFileAndWait(ZipFileName+Zparam, False, True);

{  if ReturnValue <= 32 then
    case Returnvalue of
      0                   : ShowMessage('Out of Memory ('+ZipFileName+').');
      ERROR_FILE_NOT_FOUND: ShowMessage('File not found ('+ZipFileName+').');
      ERROR_PATH_NOT_FOUND: ShowMessage('Directory not valid ('+ZipFileName+').');
      ERROR_BAD_FORMAT    : ShowMessage('Wrong format in EXE ('+ZipFileName+').');
      // All other errors. See help for more ReturnValues of ShellExecute
    else
      ShowMessage('ShellExecute failed.');
  end
}
End;
0
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6441649
Hello
  if you want to use winzip from delphi
here's some links will help you

Integrating Winzip to your Applications
http://www.undu.com/Articles/991208d.html

Get Zip Functionality for Free
http://www.borland.com/delphi/news/delphi_developer/vicaria/

Best regards
Mohammed Nasman
0
 
LVL 6

Expert Comment

by:Stuart_Johnson
ID: 6443223
I still think you are asking for trouble calling stuff from the command line.  Especially creating a spawning a batch file.  It's a very ugly, bodgey way of doing it.  That's just my opinion.
0
 
LVL 17

Expert Comment

by:geobul
ID: 9289397
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

split points between mnasman and thornolde

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thanks,

geobul
EE Cleanup Volunteer
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question