ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Executable functions
  • Program execution mode
  • Keywords of API "VerQueryValue" function
  • Executing the function in test mode in Windows
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
Retrieves the specified information about the version of an executable or DLL.

Example
WINDEVUser code (UMC)
VersionProg is string
VersionProg = ExeInfo(exeVersion, "Appli.exe")
IF VersionProg <> "2.0A" THEN
	Error("La version du programme installé n'est pas la bonne")
END
WINDEVUser code (UMC)
// Récupérer le nom de l'application (sans le chemin complet)
NomProg = ExeInfo("OriginalFilename", "Appli.exe")
// L'exécutable n'a pas été renommé
NomProg = fExtractPath(ExeInfo(exeName), fFile + fExtension)
WINDEVUser code (UMC)
sRepExe is string 
IF InTestMode() = True THEN 
	// En mode test on renvoie le répertoire d'exécution
	sRepExe = fCurrentDir()
ELSE
	sRepExe = ExeInfo(exeDirectory)
END
Syntax
<Result> = ExeInfo(<Keyword> [, <Executable name>])
<Result>: Character string
  • Requested information.
  • Empty string ("") if there is no information or if the function failed.
<Keyword>: String constant
Information to retrieve:
exeCompanyName entered for the company when creating the executable.
Linux This constant is not available.
exeCopyrightCopyright of program
LinuxJava This constant is not available.
exeDescriptionDescription supplied with the program
Java Version of JRE (Java Runtime Environment) with which the current application is run.
Linux This constant only operates with the PC SOFT libraries or executables.
exeDirectoryDirectory of the executable (without the final \ but with the ":")
Java This constant is not available.
If this constant is specified, <Result> can correspond to:
  • empty string ("") if the application was manually started by the user.
  • the exePushNotification constant if the application was automatically started by the system further to the reception of a push notification.
  • the exeInBackground constant if the application was started in the background (detection of group of Beacons or during geolocation tracking).
  • the exeGeoTracking constant if the application was started in the background during the geolocation tracking. For more details, see Geolocation tracking.
    This constant is kept for backward compatibility from version 230050. It is equivalent to the exeInBackground constant.
exeModeProgram mode: compiled in 32 or 64 bits, etc.
Java This constant is not available.
Linux This constant returns an empty string ("").
exeNameName and full path of the executable.
Java Name of Java archive for the application currently run.
Warning: This name does not correspond to the name of the application package..
exeVersionVersion of specified module.
Linux This constant only operates with the PC SOFT libraries or executables.
Java Version number of application.
exeVersionWindowsFormatVersion of specified module in standard Windows format ("14.0.204.98" for example).
LinuxJava This constant is not available.
<Executable name>: Optional character string
Name and full (or relative) path of the executable or module used (up to 260 characters). If this parameter is not specified, the current executable is used.
Java This parameter must not be specified.
Remarks
WINDEVUser code (UMC)

Program execution mode

To get the program execution mode, use the exeMode constant:
ModeProg = ExeInfo(exeMode)
The function result can correspond to:
  • "16" if the Windows program is compiled in 16 bits,
  • "32" if the Windows program is compiled in 32 bits,
  • "64" if the Windows program is compiled in 64 bits,
  • "DOS" if the program is a DOS program,
  • an empty string ("") if the program is not an executable.
WINDEVWindowsUser code (UMC)

Keywords of API "VerQueryValue" function

The <Keyword> parameter can be replaced with one of the keywords used by the API "VerQueryValue" function:
"Comments" "LegalTrademarks"
"CompanyName" "OriginalFilename"
"FileDescription" "PrivateBuild"
"FileVersion" "ProductName"
"InternalName" "ProductVersion"
"LegalCopyright" "SpecialBuild"
WINDEV

Executing the function in test mode in Windows

When ExeInfo is executed in test mode from WINDEV, the information returned about the current executable is that of "WDTst", the WINDEV test engine (located in the "Programs" subdirectory of the WINDEV installation directory).
Component: wd300std.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Exemplo ExeInfo
//Versão desse programa
s_versao_programa is string=""
s_versao_programa=ExeInfo(exeVersion)

//Versão do programa matos_utilitarios.exe
s_versao_programa=ExeInfo(exeVersion,"D:\erpmatos\matos_utilitarios\matos_utilitarios.exe")

//Versão do programa matos_utilitarios.exe 32 ou 64
s_versao_programa=ExeInfo(exeMode,"D:\erpmatos\matos_utilitarios\matos_utilitarios.exe")

//Versão do programa matos_utilitarios.exe - pegar diretorio e nome

s_versao_programa=ExeInfo(exeName,"D:\erpmatos\matos_utilitarios\matos_utilitarios.exe")

//Versão do programa matos_utilitarios.exe - pegar nome diretorio
s_versao_programa=ExeInfo(exeDirectory,"D:\erpmatos\matos_utilitarios\matos_utilitarios.exe")

//Blog com Video e exemplo
http://windevdesenvolvimento.blogspot.com.br/2016/06/curso-windev-funcoes-exe-windows-005.html
https://www.youtube.com/watch?v=m5wOrLUt9Ik

De matos AMARILDO
02 Jun. 2016

Last update: 03/28/2025

Send a report | Local help