diff --git a/dlls/msi/install.c b/dlls/msi/install.c index 8724c95b039..cb43403a675 100644 --- a/dlls/msi/install.c +++ b/dlls/msi/install.c @@ -30,6 +30,7 @@ #include "msidefs.h" #include "msipriv.h" #include "action.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(msi); @@ -760,3 +761,30 @@ LANGID WINAPI MsiGetLanguage(MSIHANDLE hInstall) msiobj_release( &package->hdr ); return langid; } + +/*********************************************************************** + * MsiGetLanguage (MSI.@) + */ +UINT WINAPI MsiSetInstallLevel(MSIHANDLE hInstall, 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); + + 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 ); + msiobj_release( &package->hdr ); + return r; +} diff --git a/dlls/msi/msi.spec b/dlls/msi/msi.spec index 8dfade16290..d6963190013 100644 --- a/dlls/msi/msi.spec +++ b/dlls/msi/msi.spec @@ -133,7 +133,7 @@ 137 stdcall MsiSetExternalUIW(ptr long ptr) 138 stdcall MsiSetFeatureStateA(long str long) 139 stdcall MsiSetFeatureStateW(long wstr long) -140 stub MsiSetInstallLevel +140 stdcall MsiSetInstallLevel(long long) 141 stdcall MsiSetInternalUI(long ptr) 142 stub MsiVerifyDiskSpace 143 stdcall MsiSetMode(long long long)