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
Solved

Using Winzip in delphi

Posted on 2001-08-30
8
1,057 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi XE10, MySQL Query 4 165
code issue 8 155
Delphi 2 69
Unique identifier on a terminal server (rdp) 4 67
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 my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

828 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