Get application information
This command allows you to check if specific widely known applications are installed on the user’s computer and get the current version and path to executable files. For example, say your program works with Microsoft Excel and you need to know if it is installed on the user’s computer, and if installed find out its version.
Opposite the necessary application, specify the variable name to which the full path to an executable file of that application will be written. If the application is not on the user’s computer, the value of this variable will be empty. The current version of the application will also be assigned to the variable [varname]_ver. If the application is not installed, the value of this variable will be 0. For MS Office applications, the variable [varname]_title will be created, which contains the generic name and year of release, for example, Office 2007. Once more variable [varname]_is64 equals 1, if the application is a 64-bit program.
Description
Optionally, you may add comments here describing the purpose of this element.
Microsoft Office Excel
Getting information about MS Excel. If, for example, you specified excel and the user has MS Office Excel 2010 installed, you can get the following values, which can be used in various commands. Word and PowerPoint will have similar results.
excel = C:\Program Files\Microsoft Office 2010\Office14\EXCEL.EXE excel_ver = 14 excel_title = Office 2010 excel_is64 = 1
Microsoft Office Word
Get information about MS Word.
Microsoft Office PowerPoint
Get information about MS PowerPoint.
Microsoft Office Access
Get information about MS Access.
Microsoft Office Outlook
Get information about MS Outlook.
Java Runtime Environment
Get information about Java Runtime Environment.
Anti-virus Information
Get information about the installed antivirus program(s).
Firewall Information
Get information about the installed firewall program(s).
For Anti-virus and Firewall:
These parameters are only available for Windows Desktop Versions. Windows Server versions are not supported.
The [variable name] value is 0, if there is no program installed and 1, if it is, but if the query fails, the value is 255.
Its value can be 2 or 3 if there are more programs found. The [variable name]_title contains the program name, [variable name]_ver the version number, [variable name]_state its status. The status is 1, if the program is active and 0 if is off. If [variable name] is greater than 1, there are several programs found. In this case, use [variable name]2, [variable name]2_title, [variable name]2_ver, [variable name]2_state names. If 3, then [variable name]3_title, etc.
Get Application Information command
If the user has several versions of Microsoft Office installed, you can also get information about all installed versions. You can use the global variables gexcel, gword, gpoint in commands Source code. Each of these arrays will be populated only if you get information about the corresponding program.
type appinfo { uint ver str filename str title uint is64 } global { arr gexcel of appinfo arr gword of appinfo arr gpoint of appinfo arr gaccess of appinfo arr goutlook of appinfo }
Let's look at an example of using the variable "gexcel" to choose from installed versions of Excel in a Combobox in Dialog – Settings. Call the command, then enter the fragment below into the Source Code command. After this, specify the variable name excels for Combobox in Dialog – Settings. As a result, the variable excels will contain the full path to the file excel.exe for the version that the user chose.
uint i str out fornum i, *gexcel { // print("Ver=\( gexcel[i].ver) title=\( gexcel[i].title) Filename=\( gexcel[i].filename) // is64=\(gexcel[i].is64)\l") out += "\( gexcel[i].title)= \( gexcel[i].filename)\l" } macrox_setstr( "excels_list", out )