Introduction

It has 4 patterns to help selecting files easily; Beside standard zip files, ZEX can also create self-expanding console programs, and the console programs are programmable - you can use javascript or vbscript to manipulate the zip contents. Of course, ZEX can also decompress ZIP files.

Specifications
Compressing Function - Command Line Arguments Explained

Syntax: zex  +z  input1;input2...inputN  output  [/password:text]   [/comments:text]  [/companyName:text]  [/fileDescription:text]

SN Value Notes
1 +z +z means compressing files into a zip file.
2 Input1;Input2;...;InputN

ZEX has 4 Input Patterns:

  • Simple Input. Example: My.jpg
  • Wildcard Input. Example: *.jpg
  • Folder with Extra Filter. Example: MyDocs/+*.doc?;+*.xls?-Private.doc?/
  • Wildcard with Extra Filter. Example: MyPics\*.*/-*.bmp;-@h/

Exra Filter

  • Extra Filter must be enclosed inside two '/', example: /+*.doc?;+*.xls?/
  • Extra Filter can have one or more fields. Multiple fields are seperated with ';'
  • Each field begins with '+' or '-'. A '+' field means "I want such files", and a '-' field means "I dont want such files".
  • A right field overrides a left field. For example, /+*.doc;-myPrivate.doc/ means 'all .doc files but myPrivate.doc'

@ Field

  • Exra Filter can have one or more @ fields;
  • A @ field begins with @ and followed by one or more of d,h,r,s,t, where d = directory, r=read only, h=hidden, s=system, t=last-write-time.
  • Last-write-time must begin either with '+', which means since, or '-', which means before, and it must be in numbers and in year-month-day-hour-minute-second format. hour-minute-second can be omitted, but year-month-day can not.
  • Example 1: /+*.*;-@dhrs/ means 'Don't scan sub-folders, and I dont want hidden, readonly or system files.'
  • Example 2: /+*.doc;+@t+2011-1-1/ means 'Get me all .doc files since 2011-1-1'
3 Output

A .zip file or or .exe file. For .zip file, a standard zip file is created. For .exe file, a self-expanding console program file is created.

4 /password:actual password

Optional, only for .zip output.

5 /Comments:text

Optional, only for .exe output.
The text will be put to the VersionInfo's 'Comments' field of the exe file.

6 /CompanyName:text

Optional, only for .exe output.
The text will be put to the VersionInfo's 'CompanyName' field of the exe file.

7 /FileDescription:text

Optional, only for .exe output.
The text will be put to the VersionInfo's 'FileDescription' field of the exe file.

Decompressing Function - Command Line Arguments Explained

Syntax: zex  -z  zip-file-name  output-folder  [/password:text]

SN Value Notes
1 -z -z means decompressing a zip file.
2 ZIP file name The name of the zip file to be decompressed.
3 Output Folder The name of the folder where the decompressed files to be written to.
4 /password:actual password

Optional, only when the zip file has been compressed with a password

Usage Examples:
Self-Expanding Console Program

To create a self-expanding console program is similar to creating a zip file, the difference is to set the output to a .exe file. When the self-expanding console program is started with no command line arguments, it says:

This a self-expanding-zip program created with XUEBROTHERS ZEX
To expand the ZIP contents to the current directory, type:  "ProgramName ."
To expand the ZIP contents to a different directory, type:  "ProgramName directoryName"

ProgramName is the actual output file name.

Programming the Self-Expanding Console Program

If one of the input files is 'autozex.js' or 'autozex.vbs', the self-expanding program just executes the script. For a quick understanding, lets make a simple self-expanding console program with 2 files: 'autozex.js' and a 'demo.jpg'. The content of 'autozex.js' is:

var zip=zex.GetZIP(); //get the zip contents. zex is a built-in object
var dir=zex.GetCurrentProgramDirectory(); //the directory where the self-expanding program is
if(zip.UnZipItem("demo.jpg", dir, false)) //expanding demo.jpg
{
    var demoPath=dir + "\\demo.jpg";      //the full path of the demo.jpg
    zex.Print("Open " + demoPath + "\n"); //displaying some message
    zex.system("start " + demoPath);      //open the expanded demo.jpg
    zex.SetAppReturnValue(0);             //set the program's return value to 0
}
else
{
    zex.SetAppReturnValue(1);
    zex.Print("Error.\n");
}

As described above, when making a self-expanding program, 3 extra command argumens can be specified, they are:

These are standard version info items of a program file. Also a fourth item, 'SpecialBuild', is automatically set by ZEX. It's value is set to the date and time (formated like '2011-01-02 12:23:34') when the self-expanding program is created.

What the use of these version info items? There are times when the self-expanding program is for other programs to run, instead of to be run by human beings manually. For example, the self-expanding program may be a upgrading program for a web site, and the web site program may need to check if the self-expanding program is the right program by reading its version info. Below are some sample C# codes that may be used in a ASPX web site's upgrading page:

FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(uploadedFilePath);
if (fvi == null ? true : (fvi.FileDescription == null ? true : fvi.FileDescription != "ABC Web Site Upgrade Module"))
{
    Status.Text = "What you uploaded is not a upgrade program file.";
    return;
}
if (fvi == null ? true : (fvi.SpecialBuild == null ? true : fvi.SpecialBuild.CompareTo(prevUpgradBuild)<0))
{
    Status.Text = "What you uploaded is older version.";
    return;
}
Programming Interfaces of the Self-Expanding Console Program
Methods of ZEX
Methods of ZIP
Buy ZEX

The price is USD 35.00. Please read our policy first:

Please click the PayPal link below ti make the payment

The product will be delivered via email within 36 hours afeter PayPal has confirmed your payments. The email will have a download link to the product.