PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

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
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
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 named "Archive"
ResOpenArchive = zipOpen("Archive", "D:\Backups\Backup.WDZ")
IF ResOpenArchive = 0 THEN
// Create a self-extracting archive
ResArchiveExe = zipCreateExe("Archive", "C:\Directories\Archive.EXE")
...
END
Syntax
<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
zipAdministrator
New in version 18
zipAdministrator
zipAdministrator
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>).
zipTempDirectory
(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.
Remarks

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.
Caution:
  • 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 coming from a WINDEV archive can be opened by zipOpen and it can be used like any 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.
Caution:
  • 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:
[GENERAL]
NATIONDEFAUT=1
[WDAUTOEX01]
R000=Self-extracting PC SOFT archive
R001=Extract the content of the archive in the directory:
R002=Keep the tree structure
R003=Extract
R004=Close
For example, to get an interface in French:
[GENERAL]
NATIONDEFAUT=1
[WDAUTOEX01]
R000=Archive Autoextractible PC SOFT
R001=Extraire le contenu de l'archive dans le repertoire:
R002=Conserver l'arborescence
R003=Extraire
R004=Fermer
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:
/DIR=<Directory>
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.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230zip.dll
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment