IEXPRESS: WINDOW’S COMPRESSION TOOL FOR SELF-EXTRACTING FILES

 Introduction

If you are in need of a self-extracting executable, check out Window’s built-in compression tool, iexpress.exe, before investing money on a third-party solution like WinZip. Using Windows native compression format, Cabinet (or CAB for short), the compressed files are more like mini-installation programs with the compressor including support for license files, prompt windows, and the launch of other applications when extraction is finished. Configuration and creation of an executable is an easy step-by-step process handled via the IExpress Wizard. At the end of the wizard, the option to save your configuration as a Self Extraction Directive file (or SED for short) is available.  These SED files can be loaded at the start of the wizard or supplied as arguments in the Windows command line, negating the need to complete the wizard twice for the same file. The command line support also makes iexpress.exe perfect for automated tasks via batch files or in custom software.

While iexpress is a great and convenient tool, there is also a few downsides one should be aware of before using it as a solution. For example, a default folder to extract to cannot be defined for the executable and must always be entered in manually before extracting. Also, an executable created with the 64-bit version of the application cannot be decompressed on 32 bit architecture.

Tutorial

For a quick tutorial, we will run through the process of using the wizard to create our first executable, saving our chosen configuration as an SED file, and creating a batch file that make uses of this SED configuration to automatically generate all future executables…

1. Run iexpress.exe from the command line. NOTE: This defaults to the 64-bit version on 64 bit Windows. To use the 32 bit, you have to directly run the iexpress.exe file in SystemWOW64.
2. Choose Create new Self Extraction Directive file.
3. Choose the Package purpose you wish to create. Information about each package type can be found in the description window.
4. Enter the Package title.
5. If you want the user to be prompted with a message at the start of the extraction process, choose Prompt user with: and then type in the message you wish to be displayed
6. If you have a license file to display, choose Display a license: and then click Browse to select the license file.
7. Click Add and select the files you wish to be compressed into the package.
8. If you choose Extract files and run an installation command during Package purpose, you will now be prompted to choose an executable to run or enter a Windows command to execute when the executable is done extracting it’s files.
9. Leave Default selected for Show window
10. If you wish for a message to be displayed when the executable is done extracting, click Display message and type in your message.
11. Enter a full path and file name for the executable.
12. Make sure Save Self Extraction Directive (SED) file is selected. Choose a folder to store the SED file.
13. Clicking Next one more time will create your first executable and then save the SED file.
14. Open Notepad.
15. Type the following: iexpress /N c:/pathTo/SEDFile.SED using your own path for your SED file. The /N argument will skip the wizard and force the iexpress to create the executable from the SED.
16. Save the file as iexpress_test.batch.
17. Double click the file to create a new executable. You will notice the previous one, if it has not been removed from it’s folder, will automatically be overwritten.

External Resources

Command line switches for the executable: http://support.microsoft.com/kb/197147

Example SED File

[Version]
Class=IEXPRESS
SEDVersion=3
[Options]
PackagePurpose=InstallApp
ShowInstallProgramWindow=0
HideExtractAnimation=1
UseLongFileName=0
InsideCompressed=0
CAB_FixedSize=0
CAB_ResvCodeSigning=0
RebootMode=N
InstallPrompt=%InstallPrompt%
DisplayLicense=%DisplayLicense%
FinishMessage=%FinishMessage%
TargetName=%TargetName%
FriendlyName=%FriendlyName%
AppLaunched=%AppLaunched%
PostInstallCmd=%PostInstallCmd%
AdminQuietInstCmd=%AdminQuietInstCmd%
UserQuietInstCmd=%UserQuietInstCmd%
SourceFiles=SourceFiles
[Strings]
InstallPrompt=
DisplayLicense=
FinishMessage=
TargetName=X:kix410registry.exe
FriendlyName=KiXtart 4.10 installation with file associations
AppLaunched=kix32.exe
PostInstallCmd=kix32.exe install.kix
AdminQuietInstCmd=
UserQuietInstCmd=
FILE0=”install.kix”
FILE1=”start1.kix”
FILE2=”start2.kix”
FILE3=”kedit.ico”
FILE4=”kix32.exe”
FILE5=”kx16.dll”
FILE6=”kx32.dll”
FILE7=”kx95.dll”
[SourceFiles]
SourceFiles0=X:
[SourceFiles0]
%FILE0%=
%FILE1%=
%FILE2%=
%FILE3%=
%FILE4%=
%FILE5%=
%FILE6%=
%FILE7%=

  • By Jason Webster, November 20, 2011
  • Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *


nine + = fifteen

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

WP-Backgrounds Lite by InoPlugs Web Design and Juwelier Schönmann 1010 Wien