Home | Sign in | English US
  • Use condition
  • Error codes
  • Stored path of archive files
  • Self-extracting archive
  • Closing the archive
  • Translating the interface for self-extraction ( parameter)
  • The executable is found on a media from which the archive files cannot be extracted
  • The self-extracting archive contains executable files
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Stored procedures
Creates a self-extracting archive in executable format (.EXE). When this executable is run, the files found in the archive are automatically decompressed on the current computer.
// Open the archive "MyArchive"
MyArchive is zipArchive
ResOpenArchive = zipOpen(MyArchive, "D:\Backups\Backup.WDZ")
IF ResOpenArchive = 0 THEN
// Create a self-extracting archive
ResArchiveExe = zipCreateExe(MyArchive, "C:\Directories\Archive.EXE")
<Result> = zipCreateExe(<Archive> , <Executable path> [, <Extraction options> [, <Executable icon> [, <Default extraction directory> [, <Translation of self-extracting program>]]]])
<Result>: Integer
  • 0 if the executable was created,
  • An error code (value greater than 0) otherwise. See the Notes for more details.
<Archive>: Character string (with quotes) or zipArchive variable
Name of archive to use.
This name can correspond to:
<Executable path>: Character string (with quotes)
Path of executable to create (up to 260 characters). This path can be a path relative to the current directory or a full path.
The .EXE extension is mandatory.
<Extraction options>: Optional constant
Extraction options to use:
Versions 18 and later
New in version 18
Forces the created executable to be run as administrator. This mode is used to avoid the virtualization of files from Windows Vista.
zipTreeThe archive files will be extracted according to the tree structure of directories found in the archive.
zipWithGUIThe self-extracting program will display a dialog box allowing the user to chose the destination directory.
zipSelectRestorePathThe self-extracting program will display the "Keep the tree structure" check box in the dialog box.
zipCurrentDirectoryAll the archive files will be extracted into the current directory.
zipDefaultDirUses the default directory (<Default extraction directory>).
(Default value)
The archive files will be extracted from the temporary directory of the computer where the executable is run. All the files are extracted into the same location.
<Executable icon>: Optional character string (with quotes)
Path of the icon file representing the created executable. This path can correspond to a path relative to the current path or to a full path.
If this parameter is not specified, a default icon will be assigned to the executable ( Default executable icon ).
<Default extraction directory>: Optional character string (with quotes)
Directory proposed by default by the decompression window (if the zipWithGUI constant is proposed). If no extraction interface is proposed, this directory will be used by default to extract the archive files.
<Translation of self-extracting program>: Optional character string (with quotes)
Full path of file (INI format) that contains the translation of messages for the self-extracting program. The format of this file is presented in details in the Notes.

Use condition

A self-extracting archive can be created if:
  • The archive exists (an archive is created by zipCreate).
  • The archive is accessible in read/write.
  • The archive is a single-part archive.
  • Archives in "CAB" format: This function is not available.
  • Archives in "RAR" format: This function is not available.
  • Archives in "7z" format: This function is not available.
  • Archives in "TAR" and "TARGZ" format: This function is not available.

Error codes

The following error codes are returned:
  • 10: Insufficient space to create the executable or the user has no write rights on the initial archive (.WDZ).
  • 11: The icon is not found or the icon format is invalid.
  • 12: Insufficient space to create the executable or the user has no read rights on the initial archive (.WDZ).
The message corresponding to the error code is returned by zipMsgError.

Stored path of archive files

When the files are extracted from a self-extracting archive, the stored path of the files is not kept. Only the name and the extension of the files are stored.

Self-extracting archive

A self-extracting archive from a WINDEV archive can be opened with zipOpen and be used like any other archive.
The source archive (.WDZ or .ZIP) cannot be rebuilt from a self-extracting archive.
No password can be defined for a self-extracting archive.
  • A self-extracting archive in ZIP format cannot be opened by zipOpen.
  • If the self-extracting archive contains empty and non-empty sub-directories, when decompressing the archive, only the directories that contain a file are re-created.

Closing the archive

Once zipCreateExe has been used on an archive, this archive is not closed. You must call zipClose to close the source archive.

Translating the interface for self-extraction (<Translation of self-extracting program> parameter)

The interface of the self-extracting program can use a language other than the default language (English).
=Interface of self-extracting tool
To do so, create a .INI file containing the following information:
R000=Self-extracting PC SOFT archive
R001=Extract the content of the archive in the directory:
R002=Keep the tree structure
For example, to get an interface in French:
R000=Archive Autoextractible PC SOFT
R001=Extraire le contenu de l'archive dans le repertoire:
R002=Conserver l'arborescence
Caution: The first three lines of this file must not be modified.
In the following lines, specified the requested translation.
The "Translation of self-extracting program" parameter must correspond to the path of the .INI file containing the translation of the interface.

The executable is found on a media from which the archive files cannot be extracted

The executable may be found on a media (CD for example) from which the archived files cannot be extracted. In this case, run the executable and specify in the command line:
The <Directory> parameter specifies the location from which the archive files must be extracted. If the <Directory> parameter contains space characters, the character string must be enclosed in quotes.
This parameter has priority over the <Extraction directory> parameter.

The self-extracting archive contains executable files

If the last archived file is an executable (.EXE), this file will be automatically run once all the archive files have been extracted.
Component : wd240zip.dll
Minimum required version
  • Version 9
This page is also available for…
Video zipCreateExe

Mar. 07 2019