More
than a set of
Zip and Unzip Components!
ZipTV is a suite of over 37
compression related components!
TZipRun Component
v2006.2+
This article references the TZipRun component revisions to v2006.2. It includes the ability to extract selected files from an archive and shell to (execute) only one of them. It recreates the directory structure stored within the archive and extracts the selected files accordingly.
This functionality is demonstrated in the following example. The following screen shots are from the demo application (demos\MainDemo\MainDemo.dpr) from the ZipTV Compression components v2006.2.
Demo Start:

In the above screen shot (some columns were collasped for this demo), notice the files that are hilighted. One is a Delphi project file (Project1.dpr) we'll call the "action file", the other two are supporting files that Delphi will attempt to open when it opens Project1.dpr.
TZipRun will execute the action file, and simply extract the other two dependant files for support of the action file.
Example:
Var
ZipRun1: TZipRun;
ZipRun1.FileSpec.Add(All selected files);
ZipRun1.Execute('Project1.dpr');

Ever clicked on a .pas file (unit1.pas) in an archiver and get this ever so familiar error message from Delphi? This is because there was no functionality in the archiver to also extract the action files supporting files.
Now that we have our three files selected, lets extract them and run the action file. On the menu bar, select the "View/Run" item:
Note the files selected in the previous screen are added to the listbox in this screen.
Select file to run (from screen show above): When the screen displayed, no files were selected. we hilighted "Examples\Project1.dpr" as the action file. One file must alwasys be the action file. The remaining files are considered support files. In this demo, the selected file from the list is the action file.
OpenMethod Property
The radio buttons in this section coincide with TZipRun.OpenMethod property.
omRegisterAssoc: this setting will extract all selected files, run the program associated with the action files filetype assigned to it in the Window's registry. The action file becomes that programs command-line parameter.
Don't confuse this with the CommandLineParam property value. The action file is always the compressed file used in TZipRun.Execute('Project1.dpr') method. The TZipRun.CommandLineParam will never be assigned a compressed file-name. See the following omCmdLine and omOpenWithFile for examples of the CommandLineParam property assignment.
omCmdLine: this setting will basically be for executable type compressed files. This means the action file must be an executable. This is the only type of file that at present can accept command-line parameters. The action file will be the selected .exe file and the setting of the CommandLineParams property will be it's command-line parameter. In the above screen shot, note there is an edit box beside this item.
omOpenWith: this setting calls the Windows open with dialog box:
Support files to 'extract': this demo uses these radio buttons to assign TZipRun's FileSpec property.
The focus in TZipRun are the FileSpec, OpenMethod, and CommandLineParams properties. The TZipRun's "execute" method must always be called with an action file. The action file must actually exists as a compressed file with the archive. The example method call for this demo is ZipRun1.Execute('Project1.dpr');
Other examples of the usage of this component would be an application containing database or image files that the application are dependant on to function properly.