20#define WIN32_LEAN_AND_MEAN
33static bool GetMsiPropW( MSIHANDLE hMSI,
const wchar_t* pPropName,
wchar_t** ppValue )
36 if ( MsiGetPropertyW( hMSI, pPropName,
const_cast<wchar_t *
>(L
""), &sz ) == ERROR_MORE_DATA )
39 DWORD nbytes = sz *
sizeof( wchar_t );
40 wchar_t* buff =
static_cast<wchar_t*
>( malloc( nbytes ) );
42 ZeroMemory( buff, nbytes );
43 MsiGetPropertyW( hMSI, pPropName, buff, &sz );
59 va_start(
args, pFormat );
60 StringCchVPrintfW( buffer,
sizeof(buffer)/
sizeof(buffer[0]), pFormat,
args );
61 OutputDebugStringW( buffer );
71extern "C" __declspec(dllexport) UINT __stdcall CheckVersions( MSIHANDLE hMSI )
75 wchar_t* pVal =
nullptr;
77 if (
GetMsiPropW( hMSI, L
"NEWPRODUCTS", &pVal ) && pVal )
85 if (
GetMsiPropW( hMSI, L
"OLDPRODUCTS", &pVal ) && pVal )
static bool GetMsiPropW(MSIHANDLE hMSI, const wchar_t *pPropName, wchar_t **ppValue)
void OutputDebugStringFormatW(PCWSTR pFormat,...)
__declspec(dllexport) UINT __stdcall CheckVersions(MSIHANDLE hMSI)
void SetMsiErrorCode(int nErrorCode)
#define MSI_ERROR_OLD_VERSION_FOUND
#define MSI_ERROR_NEW_VERSION_FOUND