From 0dd2e602e5c1b46e82abc6051677aeaab1d265b8 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 28 Sep 2017 12:40:42 +0300 Subject: Drop check for Windows versions we don't support Since we dropped support of Vista and below in master toward 6.0, those checks are needless. Removing the code that only worked in older versions, and streamlining the resulting code. Also, use kernel32.dll version for Windows version, instead of deprecated GetVersionEx, and inconvenient VersionHelpers. Since both GetVersion(Ex) and VersionHelpers (based on VerifyVersionInfo) are subject to manifest-based behavior since Windows 8.1, this move will hopefully result in more reliable OS version detection. Change-Id: I3edd8fc1843e64b6a65bd3a126be6a085511f13c Reviewed-on: https://gerrit.libreoffice.org/42905 Reviewed-by: Noel Grandin Reviewed-by: Mike Kaganski Tested-by: Mike Kaganski --- .../shellextensions/startmenuicon.cxx | 32 ++-------------------- 1 file changed, 2 insertions(+), 30 deletions(-) (limited to 'setup_native/source/win32') diff --git a/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx b/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx index ad736270b2d2..7534c4cfc50e 100644 --- a/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx +++ b/setup_native/source/win32/customactions/shellextensions/startmenuicon.cxx @@ -29,37 +29,9 @@ extern "C" UINT __stdcall InstallStartmenuFolderIcon( MSIHANDLE handle ) { std::wstring sOfficeMenuFolder = GetMsiPropertyW( handle, L"OfficeMenuFolder" ); std::wstring sDesktopFile = sOfficeMenuFolder + L"Desktop.ini"; - std::wstring sIconFile = GetMsiPropertyW( handle, L"INSTALLLOCATION" ) + L"program\\soffice.exe"; -// the Win32 SDK 8.1 deprecates GetVersionEx() -#ifdef _WIN32_WINNT_WINBLUE - bool const bIsVistaOrLater = IsWindowsVistaOrGreater(); -#else - OSVERSIONINFOW osverinfo; - osverinfo.dwOSVersionInfoSize = sizeof(osverinfo); - GetVersionExW( &osverinfo ); - bool const bIsVistaOrLater = (osverinfo.dwMajorVersion >= 6); -#endif - - if (!bIsVistaOrLater) - { - WritePrivateProfileStringW( - L".ShellClassInfo", - L"IconFile", - sIconFile.c_str(), - sDesktopFile.c_str() ); - - WritePrivateProfileStringW( - L".ShellClassInfo", - L"IconIndex", - L"0", - sDesktopFile.c_str() ); - } - // else - // { - // // at the moment there exists no Vista Icon, so we use the default folder icon. - // // add the icon into desktop/util/verinfo.rc - // } + // at the moment there exists no Vista Icon, so we use the default folder icon. + // add the icon into desktop/util/verinfo.rc // The value '0' is to avoid a message like "You Are Deleting a System Folder" warning when deleting or moving the folder. WritePrivateProfileStringW( -- cgit