MsiGetProductInfoFromScriptA function (msi.h)

The MsiGetProductInfoFromScript function returns product information for a Windows Installer script file.

Syntax

UINT MsiGetProductInfoFromScriptA(
  [in]      LPCSTR  szScriptFile,
  [out]     LPSTR   lpProductBuf39,
  [out]     LANGID  *plgidLanguage,
  [out]     LPDWORD pdwVersion,
  [out]     LPSTR   lpNameBuf,
  [in, out] LPDWORD pcchNameBuf,
  [out]     LPSTR   lpPackageBuf,
  [in, out] LPDWORD pcchPackageBuf
);

Parameters

[in] szScriptFile

A null-terminated string specifying the full path to the script file. The script file is the advertise script that was created by calling MsiAdvertiseProduct or MsiAdvertiseProductEx.

[out] lpProductBuf39

Points to a buffer that receives the product code. The buffer must be 39 characters long. The first 38 characters are for the product code GUID, and the last character is for the terminating null character.

[out] plgidLanguage

Points to a variable that receives the product language.

[out] pdwVersion

Points to a buffer that receives the product version.

[out] lpNameBuf

Points to a buffer that receives the product name. The buffer includes a terminating null character.

[in, out] pcchNameBuf

Points to a variable that specifies the size, in characters, of the buffer pointed to by the lpNameBuf parameter. This size should include the terminating null character. When the function returns, this variable contains the length of the string stored in the buffer. The count returned does not include the terminating null character. If the buffer is not large enough, the function returns ERROR_MORE_DATA, and the variable contains the size of the string in characters, without counting the null character.

[out] lpPackageBuf

Points to a buffer that receives the package name. The buffer includes the terminating null character.

[in, out] pcchPackageBuf

Points to a variable that specifies the size, in characters, of the buffer pointed to by the lpPackageNameBuf parameter. This size should include the terminating null character. When the function returns, this variable contains the length of the string stored in the buffer. The count returned does not include the terminating null character. If the buffer is not large enough, the function returns ERROR_MORE_DATA, and the variable contains the size of the string in characters, without counting the null character.

Return value

Value Meaning
ERROR_SUCCESS
The function completed successfully.
ERROR_INVALID_PARAMETER
An invalid argument was passed to the function.
ERROR_MORE_DATA
A buffer was too small to hold the entire value.
ERROR_INSTALL_FAILURE
Could not get script information.
ERROR_CALL_NOT_IMPLEMENTED
This function is only available on Windows 2000 and Windows XP.

Remarks

Note

The msi.h header defines MsiGetProductInfoFromScript as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows Installer 5.0 on Windows Server 2012, Windows 8, Windows Server 2008 R2 or Windows 7. Windows Installer 4.0 or Windows Installer 4.5 on Windows Server 2008 or Windows Vista. Windows Installer on Windows Server 2003 or Windows XP. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version.
Target Platform Windows
Header msi.h
Library Msi.lib
DLL Msi.dll