From 4500afcc1be7774b3c35ab69a20e36165ca5445a Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 19 Jan 2015 18:18:20 +0100 Subject: try to fix GetVersionEx deprecation warnings from Windows SDK 8.1 Apparently GetVersionEx() is deprecated now, but the replacement header "versionhelpers.h" does not exist in older SDKs (at least not in 8.0), so try to determine the used SDK version by checking if the Windows 8.1 version constant _WIN32_WINNT_WINBLUE (0x0602) exists. http://msdn.microsoft.com/en-us/library/windows/desktop/dn424972%28v=vs.85%29.aspx Change-Id: Ia9224a8c76823ada7cb294a600046c6a0fc843ad Reviewed-on: https://gerrit.libreoffice.org/14020 Tested-by: Jenkins Reviewed-by: Michael Stahl --- .../source/win32/customactions/shellextensions/startmenuicon.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'setup_native') diff --git a/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx b/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx index f983338936f0..5f8b15e83dd2 100644 --- a/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx +++ b/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx @@ -67,11 +67,17 @@ extern "C" UINT __stdcall InstallStartmenuFolderIcon( MSIHANDLE handle ) std::_tstring sDesktopFile = sOfficeMenuFolder + TEXT("Desktop.ini"); std::_tstring sIconFile = GetMsiProperty( handle, TEXT("INSTALLLOCATION") ) + TEXT("program\\soffice.exe"); +// the Win32 SDK 8.1 deprecates GetVersionEx() +#ifdef _WIN32_WINNT_WINBLUE + bool const bIsVistaOrLater = IsWindowsVistaOrGreater() ? true : false; +#else OSVERSIONINFO osverinfo; osverinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx( &osverinfo ); + bool const bIsVistaOrLater = (osverinfo.dwMajorVersion >= 6); +#endif - if (osverinfo.dwMajorVersion < 6 /* && osverinfo.dwMinorVersion */ ) + if (!bIsVistaOrLater) { WritePrivateProfileString( TEXT(".ShellClassInfo"), -- cgit