Solved

Using Winzip in delphi

Posted on 2001-08-30
8
1,037 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Save pdf file to other location 3 79
How to fill array with TArray.Create? 14 77
Intraweb download file link ? 1 105
Delphi and Access based Enumeration 9 44
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

937 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

4 Experts available now in Live!

Get 1:1 Help Now