MsiGetProductInfoFromScriptA function

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

Syntax

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

Parameters

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.

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.

plgidLanguage

Points to a variable that receives the product language.

pdwVersion

Points to a buffer that receives the product version.

lpNameBuf

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

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.

lpPackageBuf

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

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.

Requirements

   
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