Solved

Using Winzip in delphi

Posted on 2001-08-30
8
1,031 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:
mnasman 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
 
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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:mnasman
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now