Skip to content

Commit

Permalink
[windows] require Windows 8.1 as minimum version
Browse files Browse the repository at this point in the history
- Windows 7 is unsupported since January 14, 2020
- Windows 8 is unsupported since January 12, 2016
  • Loading branch information
Rechi committed Nov 13, 2022
1 parent 670bf7a commit b07e348
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 107 deletions.
17 changes: 0 additions & 17 deletions cmake/modules/FindD3DX11Effects.cmake
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
# - Finds D3DX11 dependencies
# Once done this will define
#
# D3DCOMPILER_DLL - Path to the Direct3D Compiler
# FXC - Path to the DirectX Effects Compiler (FXC)

if(NOT CORE_SYSTEM_NAME STREQUAL windowsstore)
find_file(D3DCOMPILER_DLL
NAMES d3dcompiler_47.dll d3dcompiler_46.dll
PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0;InstallationFolder]/Redist/D3D/${SDK_TARGET_ARCH}"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.1;InstallationFolder]/Redist/D3D/${SDK_TARGET_ARCH}"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v8.0;InstallationFolder]/Redist/D3D/${SDK_TARGET_ARCH}"
"$ENV{WindowsSdkDir}Redist/d3d/${SDK_TARGET_ARCH}"
NO_DEFAULT_PATH)
if(NOT D3DCOMPILER_DLL)
message(WARNING "Could NOT find Direct3D Compiler")
endif()
mark_as_advanced(D3DCOMPILER_DLL)
copy_file_to_buildtree(${D3DCOMPILER_DLL} DIRECTORY .)
endif()

find_program(FXC fxc
PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\Microsoft SDKs\\Windows\\v10.0;InstallationFolder]/bin/x86"
Expand Down
1 change: 1 addition & 0 deletions cmake/platform/windows/windows.cmake
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
set(PLATFORM_REQUIRED_DEPS D3DX11Effects)
set(APP_RENDER_SYSTEM dx11)
list(APPEND PLATFORM_DEFINES -DNTDDI_VERSION=NTDDI_WINBLUE -D_WIN32_WINNT=_WIN32_WINNT_WINBLUE)
3 changes: 0 additions & 3 deletions lib/win32/Effects11/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ target_compile_options(effects11 PRIVATE "/permissive")

if(CORE_SYSTEM_NAME STREQUAL windowsstore)
target_compile_definitions(effects11 PRIVATE
_WIN7_PLATFORM_UPDATE
WIN32
_WINDOWS
_LIB
Expand All @@ -25,12 +24,10 @@ if(CORE_SYSTEM_NAME STREQUAL windowsstore)
)
else()
target_compile_definitions(effects11 PRIVATE
_WIN7_PLATFORM_UPDATE
WIN32
_WINDOWS
_LIB
D3DXFX_LARGEADDRESS_HANDLE
_WIN32_WINNT=0x0601
_CRT_STDIO_ARBITRARY_WIDE_SPECIFIERS
)
endif()
Expand Down
42 changes: 3 additions & 39 deletions project/Win32BuildSetup/genNsisInstaller.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -356,47 +356,11 @@ Function .onInit
${Endif}
!endif

; Win7 SP1 is minimum requirement
${IfNot} ${AtLeastWin7}
${OrIf} ${IsWin7}
${AndIfNot} ${AtLeastServicePack} 1
MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST|MB_SETFOREGROUND "Windows 7 SP1 or above required.$\nInstall Service Pack 1 for Windows 7 and run setup again."
; Windows 8.1 is minimum requirement
${IfNot} ${AtLeastWin8.1}
MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST|MB_SETFOREGROUND "Windows 8.1 or above required."
Quit
${EndIf}

Var /GLOBAL HotFixID
${If} ${IsWin7}
StrCpy $HotFixID "2670838" ; Platform Update for Windows 7 SP1
${Else}
StrCpy $HotFixID ""
${Endif}
${If} $HotFixID != ""
nsExec::ExecToStack 'cmd /Q /C "%SYSTEMROOT%\System32\wbem\wmic.exe /?"'
Pop $0 ; return value (it always 0 even if an error occurred)
Pop $1 ; command output
${If} $0 != 0
${OrIf} $1 == ""
MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST|MB_SETFOREGROUND "Unable to run the Windows program wmic.exe to verify that Windows Update KB$HotFixID is installed.$\nWmic is not installed correctly.$\nPlease fix this issue and try again to install Kodi."
Quit
${EndIf}
nsExec::ExecToStack 'cmd /Q /C "%SYSTEMROOT%\System32\findstr.exe /?"'
Pop $0 ; return value (it always 0 even if an error occurred)
Pop $1 ; command output
${If} $0 != 0
${OrIf} $1 == ""
MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST|MB_SETFOREGROUND "Unable to run the Windows program findstr.exe to verify that Windows Update KB$HotFixID is installed.$\nFindstr is not installed correctly.$\nPlease fix this issue and try again to install Kodi."
Quit
${EndIf}
nsExec::ExecToStack 'cmd /Q /C "%SYSTEMROOT%\System32\wbem\wmic.exe qfe get hotfixid | %SYSTEMROOT%\System32\findstr.exe "^KB$HotFixID[^0-9]""'
Pop $0 ; return value (it always 0 even if an error occurred)
Pop $1 ; command output
${If} $0 != 0
${OrIf} $1 == ""
MessageBox MB_OK|MB_ICONSTOP|MB_TOPMOST|MB_SETFOREGROUND "Platform Update for Windows (KB$HotFixID) is required.$\nDownload and install Platform Update for Windows then run setup again."
ExecShell "open" "http://support.microsoft.com/kb/$HotFixID"
Quit
${EndIf}
SetOutPath "$INSTDIR"
${EndIf}
StrCpy $CleanDestDir "-1"
FunctionEnd
2 changes: 0 additions & 2 deletions tools/buildsteps/windows/BuildSetup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ set WORKSPACE=%base_dir%\kodi-build.%TARGET_PLATFORM%

set EXE="%WORKSPACE%\%buildconfig%\%APP_NAME%.exe"
set PDB="%WORKSPACE%\%buildconfig%\%APP_NAME%.pdb"
set D3D="%WORKSPACE%\D3DCompile*.DLL"

POPD
ECHO Done!
Expand Down Expand Up @@ -128,7 +127,6 @@ set WORKSPACE=%base_dir%\kodi-build.%TARGET_PLATFORM%
md BUILD_WIN32\application

xcopy %EXE% BUILD_WIN32\application > NUL
xcopy %D3D% BUILD_WIN32\application > NUL
xcopy %base_dir%\userdata BUILD_WIN32\application\userdata /E /Q /I /Y /EXCLUDE:exclude.txt > NUL
copy %base_dir%\LICENSE.md BUILD_WIN32\application > NUL
copy %base_dir%\privacy-policy.txt BUILD_WIN32\application > NUL
Expand Down
4 changes: 2 additions & 2 deletions tools/buildsteps/windows/make-mingwlibs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ else
fi

if [[ $win10 = "no" ]]; then
export _WIN32_WINNT=0x0600
export NTDDI_VERSION=0x06000000
export _WIN32_WINNT=_WIN32_WINNT_WINBLUE
export NTDDI_VERSION=NTDDI_WINBLUE
elif [[ $win10 = "yes" ]]; then
TRIPLET=win10-$TRIPLET
fi
Expand Down
3 changes: 1 addition & 2 deletions xbmc/cores/VideoPlayer/DVDCodecs/Video/DXVA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,7 @@ bool CContext::CreateContext()
featureLevels.push_back(D3D_FEATURE_LEVEL_12_1);
featureLevels.push_back(D3D_FEATURE_LEVEL_12_0);
}
if (CSysInfo::IsWindowsVersionAtLeast(CSysInfo::WindowsVersionWin8))
featureLevels.push_back(D3D_FEATURE_LEVEL_11_1);
featureLevels.push_back(D3D_FEATURE_LEVEL_11_1);
featureLevels.push_back(D3D_FEATURE_LEVEL_11_0);
featureLevels.push_back(D3D_FEATURE_LEVEL_10_1);
featureLevels.push_back(D3D_FEATURE_LEVEL_10_0);
Expand Down
6 changes: 2 additions & 4 deletions xbmc/platform/win32/filesystem/Win32Directory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,8 @@ bool CWin32Directory::RemoveRecursive(const CURL& url)
HANDLE hSearch;
WIN32_FIND_DATAW findData = {};

if (g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionWin7))
hSearch = FindFirstFileExW(searchMask.c_str(), FindExInfoBasic, &findData, FindExSearchNameMatch, nullptr, FIND_FIRST_EX_LARGE_FETCH);
else
hSearch = FindFirstFileExW(searchMask.c_str(), FindExInfoStandard, &findData, FindExSearchNameMatch, nullptr, 0);
hSearch = FindFirstFileExW(searchMask.c_str(), FindExInfoBasic, &findData, FindExSearchNameMatch,
nullptr, FIND_FIRST_EX_LARGE_FETCH);

if (hSearch == INVALID_HANDLE_VALUE)
return GetLastError() == ERROR_FILE_NOT_FOUND ? Exists(url) : false; // return true if directory exist and empty
Expand Down
15 changes: 6 additions & 9 deletions xbmc/platform/win32/powermanagement/Win32PowerSyscall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,15 @@ bool CWin32PowerStateWorker::PowerManagement(PowerState State)
return SetSuspendState(false, true, false) == TRUE;
case POWERSTATE_SHUTDOWN:
CLog::Log(LOGINFO, "Shutdown Windows...");
if (g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionWin8))
return InitiateShutdownW(NULL, NULL, 0, SHUTDOWN_HYBRID | SHUTDOWN_INSTALL_UPDATES | SHUTDOWN_POWEROFF,
SHTDN_REASON_MAJOR_APPLICATION | SHTDN_REASON_MINOR_OTHER | SHTDN_REASON_FLAG_PLANNED) == ERROR_SUCCESS;
return InitiateShutdownW(NULL, NULL, 0, SHUTDOWN_INSTALL_UPDATES | SHUTDOWN_POWEROFF,
SHTDN_REASON_MAJOR_APPLICATION | SHTDN_REASON_MINOR_OTHER | SHTDN_REASON_FLAG_PLANNED) == ERROR_SUCCESS;
return InitiateShutdownW(NULL, NULL, 0,
SHUTDOWN_HYBRID | SHUTDOWN_INSTALL_UPDATES | SHUTDOWN_POWEROFF,
SHTDN_REASON_MAJOR_APPLICATION | SHTDN_REASON_MINOR_OTHER |
SHTDN_REASON_FLAG_PLANNED) == ERROR_SUCCESS;
case POWERSTATE_REBOOT:
CLog::Log(LOGINFO, "Rebooting Windows...");
if (g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionWin8))
return InitiateShutdownW(NULL, NULL, 0, SHUTDOWN_INSTALL_UPDATES | SHUTDOWN_RESTART,
SHTDN_REASON_MAJOR_APPLICATION | SHTDN_REASON_MINOR_OTHER | SHTDN_REASON_FLAG_PLANNED) == ERROR_SUCCESS;
return InitiateShutdownW(NULL, NULL, 0, SHUTDOWN_INSTALL_UPDATES | SHUTDOWN_RESTART,
SHTDN_REASON_MAJOR_APPLICATION | SHTDN_REASON_MINOR_OTHER | SHTDN_REASON_FLAG_PLANNED) == ERROR_SUCCESS;
SHTDN_REASON_MAJOR_APPLICATION | SHTDN_REASON_MINOR_OTHER |
SHTDN_REASON_FLAG_PLANNED) == ERROR_SUCCESS;
default:
CLog::Log(LOGERROR, "Unknown PowerState called.");
return false;
Expand Down
3 changes: 0 additions & 3 deletions xbmc/platform/win32/threads/Win32Exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,6 @@ bool win32_exception::write_stacktrace(EXCEPTION_POINTERS* pEp)

bool win32_exception::ShouldHook()
{
if (!IsWindows8OrGreater())
return true;

bool result = true;

auto module = ::LoadLibrary(L"kernel32.dll");
Expand Down
3 changes: 1 addition & 2 deletions xbmc/rendering/dx/DeviceResources.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,7 @@ void DX::DeviceResources::CreateDeviceResources()
featureLevels.push_back(D3D_FEATURE_LEVEL_12_1);
featureLevels.push_back(D3D_FEATURE_LEVEL_12_0);
}
if (CSysInfo::IsWindowsVersionAtLeast(CSysInfo::WindowsVersionWin8))
featureLevels.push_back(D3D_FEATURE_LEVEL_11_1);
featureLevels.push_back(D3D_FEATURE_LEVEL_11_1);
featureLevels.push_back(D3D_FEATURE_LEVEL_11_0);
featureLevels.push_back(D3D_FEATURE_LEVEL_10_1);
featureLevels.push_back(D3D_FEATURE_LEVEL_10_0);
Expand Down
18 changes: 1 addition & 17 deletions xbmc/utils/SystemInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,18 +675,6 @@ std::string CSysInfo::GetOsPrettyNameWithVersion(void)
{
switch (GetWindowsVersion())
{
case WindowsVersionWin7:
if (osvi.wProductType == VER_NT_WORKSTATION)
osNameVer.append("7");
else
osNameVer.append("Server 2008 R2");
break;
case WindowsVersionWin8:
if (osvi.wProductType == VER_NT_WORKSTATION)
osNameVer.append("8");
else
osNameVer.append("Server 2012");
break;
case WindowsVersionWin8_1:
if (osvi.wProductType == VER_NT_WORKSTATION)
osNameVer.append("8.1");
Expand Down Expand Up @@ -865,11 +853,7 @@ CSysInfo::WindowsVersion CSysInfo::GetWindowsVersion()
OSVERSIONINFOEXW osvi = {};
if (sysGetVersionExWByRef(osvi))
{
if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1)
m_WinVer = WindowsVersionWin7;
else if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 2)
m_WinVer = WindowsVersionWin8;
else if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 3)
if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 3)
m_WinVer = WindowsVersionWin8_1;
else if (osvi.dwMajorVersion == 10 && osvi.dwMinorVersion == 0 && osvi.dwBuildNumber < 16299)
m_WinVer = WindowsVersionWin10;
Expand Down
4 changes: 1 addition & 3 deletions xbmc/utils/SystemInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ class CSysInfo : public CInfoLoader, public ISubSettings
enum WindowsVersion
{
WindowsVersionUnknown = -1, // Undetected, unsupported Windows version or OS in not Windows
WindowsVersionWin7, // Windows 7, Windows Server 2008 R2
WindowsVersionWin8, // Windows 8, Windows Server 2012
WindowsVersionWin8_1, // Windows 8.1
WindowsVersionWin8_1, // Windows 8.1, Windows Server 2012 R2
WindowsVersionWin10, // Windows 10
WindowsVersionWin10_1709, // Windows 10 1709 (FCU)
WindowsVersionWin10_1803, // Windows 10 1803
Expand Down
6 changes: 4 additions & 2 deletions xbmc/utils/test/TestSystemInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ TEST_F(TestSystemInfo, IsWindowsVersion)
{
EXPECT_FALSE(g_sysinfo.IsWindowsVersion(CSysInfo::WindowsVersionUnknown)) << "'IsWindowsVersion()' must return 'false' for 'WindowsVersionUnknown'";
#ifndef TARGET_WINDOWS
EXPECT_FALSE(g_sysinfo.IsWindowsVersion(CSysInfo::WindowsVersionWin7)) << "'IsWindowsVersion()' must return 'false'";
EXPECT_FALSE(g_sysinfo.IsWindowsVersion(CSysInfo::WindowsVersionWin8_1))
<< "'IsWindowsVersion()' must return 'false'";
#endif // ! TARGET_WINDOWS
}

Expand All @@ -174,7 +175,8 @@ TEST_F(TestSystemInfo, IsWindowsVersionAtLeast)
EXPECT_FALSE(g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionUnknown)) << "'IsWindowsVersionAtLeast()' must return 'false' for 'WindowsVersionUnknown'";
EXPECT_FALSE(g_sysinfo.IsWindowsVersionAtLeast(CSysInfo::WindowsVersionFuture)) << "'IsWindowsVersionAtLeast()' must return 'false' for 'WindowsVersionFuture'";
#ifndef TARGET_WINDOWS
EXPECT_FALSE(g_sysinfo.IsWindowsVersion(CSysInfo::WindowsVersionWin7)) << "'IsWindowsVersionAtLeast()' must return 'false'";
EXPECT_FALSE(g_sysinfo.IsWindowsVersion(CSysInfo::WindowsVersionWin8_1))
<< "'IsWindowsVersionAtLeast()' must return 'false'";
#endif // ! TARGET_WINDOWS
}

Expand Down
3 changes: 1 addition & 2 deletions xbmc/windowing/windows/WinSystemWin32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -873,8 +873,7 @@ bool CWinSystemWin32::ChangeResolution(const RESOLUTION_INFO& res, bool forceCha
bool bResChanged = false;

// Windows 8 refresh rate workaround for 24.0, 48.0 and 60.0 Hz
if ( CSysInfo::IsWindowsVersionAtLeast(CSysInfo::WindowsVersionWin8)
&& (res.fRefreshRate == 24.0 || res.fRefreshRate == 48.0 || res.fRefreshRate == 60.0))
if (res.fRefreshRate == 24.0 || res.fRefreshRate == 48.0 || res.fRefreshRate == 60.0)
{
CLog::LogF(LOGDEBUG, "Using Windows 8+ workaround for refresh rate {} Hz",
static_cast<int>(res.fRefreshRate));
Expand Down

0 comments on commit b07e348

Please sign in to comment.