summaryrefslogtreecommitdiff
path: root/setup_native/source/win32/customactions/relnotes/relnotes.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'setup_native/source/win32/customactions/relnotes/relnotes.cxx')
-rw-r--r--setup_native/source/win32/customactions/relnotes/relnotes.cxx28
1 files changed, 27 insertions, 1 deletions
diff --git a/setup_native/source/win32/customactions/relnotes/relnotes.cxx b/setup_native/source/win32/customactions/relnotes/relnotes.cxx
index 77f109b01f47..d4dc7d6ecfa6 100644
--- a/setup_native/source/win32/customactions/relnotes/relnotes.cxx
+++ b/setup_native/source/win32/customactions/relnotes/relnotes.cxx
@@ -40,6 +40,7 @@
#include <malloc.h>
#include <stdio.h>
#include <strsafe.h>
+#include <string>
//----------------------------------------------------------
#ifdef DEBUG
@@ -65,6 +66,24 @@ inline bool IsValidHandle( HANDLE handle )
}
//----------------------------------------------------------
+static bool GetMsiProp(MSIHANDLE handle, LPCTSTR name, /*out*/std::wstring& value)
+{
+ DWORD sz = 0;
+ LPTSTR dummy = TEXT("");
+ if (MsiGetProperty(handle, name, dummy, &sz) == ERROR_MORE_DATA)
+ {
+ sz++;
+ DWORD nbytes = sz * sizeof(TCHAR);
+ LPTSTR buff = reinterpret_cast<LPTSTR>(_alloca(nbytes));
+ ZeroMemory(buff, nbytes);
+ MsiGetProperty(handle, name, buff, &sz);
+ value = buff;
+ return true;
+ }
+ return false;
+}
+
+//----------------------------------------------------------
//----------------------------------------------------------
//----------------------------------------------------------
UINT ShowReleaseNotes( TCHAR* pFileName, TCHAR* pFilePath )
@@ -138,8 +157,15 @@ extern "C" UINT __stdcall ShowReleaseNotesAfter( MSIHANDLE )
}
//----------------------------------------------------------
-extern "C" UINT __stdcall ShowSurveyAfter( MSIHANDLE )
+extern "C" UINT __stdcall ShowSurveyAfter( MSIHANDLE handle )
{
+ std::wstring prodname;
+
+ GetMsiProp( handle, TEXT("ProductName"), prodname );
+ std::wstring::size_type nIndex = prodname.find( TEXT( "OpenOffice.org" ) );
+ if( std::wstring::npos == nIndex )
+ return ERROR_SUCCESS;
+
OutputDebugString( TEXT("DEBUG: ShowSurveyAfter called") );
SHELLEXECUTEINFOW aExecInf;