PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • 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
  • Command line parameters of a self-extracting archive
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 "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")
...
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. For more details on these error codes, see the Remarks.
<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 from a WINDEV archive can be opened with zipOpen and handled 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.
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.

Command line parameters of a self-extracting archive

The following parameters are used to launch a self-extracting archive from the command line:
/DIR=<Directory>Used to specify where the archived files should be extracted from. If the <Directory> contains space characters, the character string must be enclosed in quotes.
Caution: This parameter has priority over the parameter <Extraction directory> specified with zipCreateExe.
/TIT=<Title><Title> corresponds to the title of the self-extracting window.
Versions 24 and later
/PID=<Num PID>
New in version 24
/PID=<Num PID>
/PID=<Num PID>
Used to wait for the end of the <PID Num> process before starting the extraction.
/SILENTUsed to start the extraction without a progress bar or a dialogue.
/WAITIf the self-extracting archive starts an executable, the first window will remain opened until the end of the executable.
/RELANCEExtraction with administrator rights.
Component : wd240zip.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Video zipCreateExe
https://youtu.be/COnZAE_mY7g

https://windevdesenvolvimento.blogspot.com/2019/03/dicas-2037-windev-curso-zip-4.html
//
zipCreate("ArquivoZip","C:\temp\Arquivo07032019.zip")
zipAddFile("ArquivoZip","C:\temp\cliente.txt",zipDrive)
zipAddFile("ArquivoZip","C:\temp\empresa.txt",zipDrive)
zipCreateExe("ArquivoZip","c:\temp\Arquivo07032019.exe",zipCurrentDirectory)
amarildo
07 Mar. 2019