MsiGetProductInfoFromScript Function

Windows Installer

MsiGetProductInfoFromScript Function

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

Syntax

C++UINT MsiGetProductInfoFromScript(
  __in     LPCTSTR szScriptFile,
  __out    LPTSTR lpProductBuf39,
  __out    LANGID *plgidLanguage,
  __out    DWORD *pdwVersion,
  __out    LPTSTR lpNameBuf,
  __inout  DWORD *pcchNameBuf,
  __out    LPTSTR lpPackageBuf,
  __inout  DWORD *pcchPackageBuf
);

Parameters

szScriptFile [in]

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 [out]

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 [out]

Points to a variable that receives the product language.

pdwVersion [out]

Points to a buffer that receives the product version.

lpNameBuf [out]

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

pcchNameBuf [in, out]

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 [out]

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

pcchPackageBuf [in, out]

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

VersionWindows Installer 5.0 on 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, Windows XP, and Windows 2000. See the Windows Installer Run-Time Requirements for information about the minimum Windows service pack that is required by a Windows Installer version.
HeaderMsi.h
LibraryMsi.lib
DLLMsi.dll
Unicode and ANSI namesMsiGetProductInfoFromScriptW (Unicode) and MsiGetProductInfoFromScriptA (ANSI)

Send comments about this topic to Microsoft

Build date: 8/13/2009

© 2009 Microsoft Corporation. All rights reserved.