Solved

Using Winzip in delphi

Posted on 2001-08-30
8
1,088 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Suggested Courses
Course of the Month4 days, left to enroll

630 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