MSI.LocateComponent

table MSI.LocateComponent ( 

string ComponentGUID )

Description

Calls the MsiLocateComponent function to get the full path to an installed component without a product code. This function attempts to determine the product using MsiGetProductCode, but is not guaranteed to find the correct product for the caller. The MSI.GetComponentPath action should always be called when possible.

Parameters

ComponentGUID

(string) The identifier (GUID) of the component to be located. This string must be an identifier string enclosed in curly braces, for example: "{1638E94C-DA3C-44BD-88FB-5CC76B59BE46}".

Returns

(table) Returns nil if the call fails or a table if successful with the following indexes:

InstallState

(number) The install state of the component represented by one of the following values:

CONSTANT

VALUE

DESCRIPTION

INSTALLSTATE_NOTUSED

-7

The component being requested is disabled on the computer.

INSTALLSTATE_SOURCEABSENT

-4

The component source is inaccessible.

INSTALLSTATE_MOREDATA

-3

The buffer provided was too small.

INSTALLSTATE_INVALIDARG

-2

One of the function parameters is invalid.

INSTALLSTATE_UNKNOWN

-1

The product code or component ID is unknown.

INSTALLSTATE_ABSENT

2

The component is not installed.

INSTALLSTATE_LOCAL

3

The component is installed locally.

INSTALLSTATE_SOURCE

4

The component is installed to run from source.

ComponentPath

(string) The path to the component. If there was an error getting the component path (i.e. InstallState returns INSTALLSTATE_UNKNOWN) then this table value will be nil.

 

If the action fails, nil is returned. You can use Application.GetLastError to determine whether this action failed, and why.

See also:  Related Actions