msi: Forward MsiSetInstallLevel to an internal MSI_SetInstallLevel that can be used internally.

This commit is contained in:
James Hawkins 2006-07-19 11:17:28 -07:00 committed by Alexandre Julliard
parent 7bcac31dcf
commit de73481c89
2 changed files with 24 additions and 10 deletions

View File

@ -762,27 +762,19 @@ LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall)
return langid;
}
/***********************************************************************
* MsiGetLanguage (MSI.@)
*/
UINT WINAPI MsiSetInstallLevel(MSIHANDLE hInstall, int iInstallLevel)
UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel )
{
static const WCHAR szInstallLevel[] = {
'I','N','S','T','A','L','L','L','E','V','E','L',0 };
static const WCHAR fmt[] = { '%','d',0 };
MSIPACKAGE* package;
WCHAR level[6];
UINT r;
TRACE("%ld %i\n", hInstall, iInstallLevel);
TRACE("%p %i\n", package, iInstallLevel);
if (iInstallLevel<1 || iInstallLevel>32767)
return ERROR_INVALID_PARAMETER;
package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
if ( !package )
return ERROR_INVALID_HANDLE;
sprintfW( level, fmt, iInstallLevel );
r = MSI_SetPropertyW( package, szInstallLevel, level );
if ( r == ERROR_SUCCESS )
@ -790,6 +782,25 @@ UINT WINAPI MsiSetInstallLevel(MSIHANDLE hInstall, int iInstallLevel)
r = MSI_SetFeatureStates( package );
}
return r;
}
/***********************************************************************
* MsiSetInstallLevel (MSI.@)
*/
UINT WINAPI MsiSetInstallLevel(MSIHANDLE hInstall, int iInstallLevel)
{
MSIPACKAGE* package;
UINT r;
TRACE("%ld %i\n", hInstall, iInstallLevel);
package = msihandle2msiinfo( hInstall, MSIHANDLETYPE_PACKAGE );
if ( !package )
return ERROR_INVALID_HANDLE;
r = MSI_SetInstallLevel( package, iInstallLevel );
msiobj_release( &package->hdr );
return r;

View File

@ -381,6 +381,9 @@ extern UINT MSI_ViewExecute( MSIQUERY*, MSIRECORD * );
extern UINT MSI_ViewFetch( MSIQUERY*, MSIRECORD ** );
extern UINT MSI_ViewClose( MSIQUERY* );
/* install internals */
extern UINT MSI_SetInstallLevel( MSIPACKAGE *package, int iInstallLevel );
/* package internals */
extern MSIPACKAGE *MSI_CreatePackage( MSIDATABASE * );
extern UINT MSI_OpenPackageW( LPCWSTR szPackage, MSIPACKAGE ** );