20#ifndef INCLUDED_SETUP_NATIVE_SOURCE_WIN32_CUSTOMACTIONS_SHELLEXTENSIONS_SHLXTMSI_HXX
21#define INCLUDED_SETUP_NATIVE_SOURCE_WIN32_CUSTOMACTIONS_SHELLEXTENSIONS_SHLXTMSI_HXX
23#define WIN32_LEAN_AND_MEAN
29static inline std::wstring
GetMsiPropertyW( MSIHANDLE handle,
const std::wstring& sProperty )
32 WCHAR szDummy[1] = L
"";
35 if ( MsiGetPropertyW( handle, sProperty.c_str(), szDummy, &nChars ) == ERROR_MORE_DATA )
37 DWORD nBytes = ++nChars *
sizeof(WCHAR);
38 PWSTR buffer =
static_cast<PWSTR
>(_alloca(nBytes));
39 ZeroMemory( buffer, nBytes );
40 MsiGetPropertyW( handle, sProperty.c_str(), buffer, &nChars );
47static inline void SetMsiPropertyW( MSIHANDLE handle,
const std::wstring& sProperty,
const std::wstring& sValue )
49 MsiSetPropertyW( handle, sProperty.c_str(), sValue.c_str() );
54 MsiSetPropertyW( handle, sProperty.c_str(),
nullptr );
static std::wstring GetMsiPropertyW(MSIHANDLE handle, const std::wstring &sProperty)
static void SetMsiPropertyW(MSIHANDLE handle, const std::wstring &sProperty, const std::wstring &sValue)
static void UnsetMsiPropertyW(MSIHANDLE handle, const std::wstring &sProperty)