[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Zipping a file with delphi

Posted on 2004-04-01
9
Medium Priority
?
795 Views
Last Modified: 2010-04-04
I need to shell winzip and zip MyFile.exe in the windows folder

i have tried this but it dosent work..

ShellExecute(handle, PCHAR('open'), PCHAR('c:\Program Files\Winzip\winzip32.exe'),'-a -r',Windir+'\NewFile.zip',Windir+'\MyFile.exe',SW_show);

or is there code to generate  a zip file whithout using winzip in your program?
0
Comment
Question by:KLOPEKS
[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
9 Comments
 
LVL 2

Expert Comment

by:Ratje
ID: 10730982
U could use ZipForge from http://www.componentace.com/

Rat
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 10730999
I am using a ZipForge component for Delphi from
http://www.aidaim.com/
It is a free for personal use ZIP compression library.
example:
    with ZipForge do
    try
          FileName := edt_Zip_Source.Text; // 'D:\SFX.zip';
          OpenArchive(fmCreate); // Create a new archive file
          BaseDir := edt_Folder_Source.Text; // 'D:\SFX'; // Set path to folder with some text files to BaseDir
          AddFiles('*.*');   // Add all files and directories from 'C:\SOURCE_FOLDER' to the archive
          CloseArchive; // Close the archive
    except
       // Without success
    end;
0
 
LVL 6

Expert Comment

by:BAlexandrov
ID: 10731018
Here one good free component
http://groups.yahoo.com/group/nanozip/

there is the discussion group, you can download it from files section - there are examples too.

Bojidar Alexandrov
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 2

Expert Comment

by:Ratje
ID: 10731059
Another good choice would be turboPower Abbrevia:
http://sourceforge.net/projects/tpabbrevia/

Rat
0
 
LVL 17

Accepted Solution

by:
mokule earned 500 total points
ID: 10731098
You call with 7 parameters whilst this function takes 6.
ShellExecute(handle,
                   PCHAR('open'),
                   PCHAR('c:\Program Files\Winzip\winzip32.exe'),
                   '-a -r', // here You should pass all parameters passed to Wnzip32 (see below)
                   Windir+'\NewFile.zip',  // default directory - not zip
                   Windir+'\MyFile.exe',   // delete this line
                   SW_show);


'-a -r '+ Windir+'\NewFile.zip' + ' ' + Windir+'\MyFile.exe',
if Your MyFile.exe is already in Windir Folder
0
 
LVL 1

Expert Comment

by:FeralCTO
ID: 10732786
esoftbg,

I looked at http://www.aidaim.com/ and was unable to find ZipForge.

0
 
LVL 12

Expert Comment

by:esoftbg
ID: 10736119
I have two accepted solutions with     http://www.aidaim.com/

01/26/2004     http://experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20862511.html

03/16/2004     http://experts-exchange.com/Programming/Programming_Languages/Delphi/Q_20921124.html

I so sorry, I am surpised:
 http://www.aidaim.com/ is changed and there is not ZipForge anymore ????

I found version 2.51 or 2.52 at:
http://www.softandco.com/download/ZipForge/download11146.html

I am using version 2.02, I'll try a new one. I just downloaded it.

emil
0
 
LVL 12

Expert Comment

by:esoftbg
ID: 10736466
I recompiled an old application which used ZipForge 2.02 with a new version 2.52, and it works fine

  // example - ZIPPING a FOLDER 'D:\SFX'

  with ZipForge do
  begin
    if DirectoryExists('D:\SFX') then
    begin
      FileName := 'D:\SFX.zip';
      OpenArchive(fmCreate); // Create a new archive file D:\SFX.zip
      BaseDir := 'D:\SFX';      // Folder to be Zipped
      AddFiles('*.*');
      CloseArchive; // Close the archive
    end;
  end;

emil
0
 

Author Comment

by:KLOPEKS
ID: 10737387
thanks!
0

Featured Post

Hire Technology Freelancers with Gigs

Work with 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.

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Suggested Courses

649 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