diff options
| author | JMC47 <JMC4789@gmail.com> | 2022-10-21 13:55:51 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-21 13:55:51 -0400 |
| commit | 00e23da6074b5b25a2ff4e4ff040986c07753e94 (patch) | |
| tree | 2831c77c6a2aabb04c1d53c408df0b20dd6d0efe /Source/Core/Common | |
| parent | 9222956acdfb6a0526b6fdada4aeaa936de9fcd1 (diff) | |
| parent | 717c36bc43c2a568b3fff04bd6d3ea2a81c0582d (diff) | |
Merge pull request #11051 from shuffle2/update-vcredist
WinUpdater: Check OS and VC++ Redist versions
Diffstat (limited to 'Source/Core/Common')
| -rw-r--r-- | Source/Core/Common/CMakeLists.txt | 11 | ||||
| -rw-r--r-- | Source/Core/Common/build_info.txt.in | 24 |
2 files changed, 35 insertions, 0 deletions
diff --git a/Source/Core/Common/CMakeLists.txt b/Source/Core/Common/CMakeLists.txt index 134d38062c..4dc764408d 100644 --- a/Source/Core/Common/CMakeLists.txt +++ b/Source/Core/Common/CMakeLists.txt @@ -324,6 +324,17 @@ if(UNIX) target_link_libraries(traversal_server PRIVATE ${SYSTEMD_LIBRARIES}) endif() elseif(WIN32) + find_package(PowerShell REQUIRED) + execute_process( + COMMAND ${POWERSHELL_EXE} -Command "[System.Diagnostics.FileVersionInfo]::GetVersionInfo('$ENV{VCToolsRedistDir}vc_redist.x64.exe').ProductVersion" + OUTPUT_VARIABLE VC_TOOLS_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/build_info.txt.in" + "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/build_info.txt" + ) + target_link_libraries(common PRIVATE "-INCLUDE:enableCompatPatches") endif() diff --git a/Source/Core/Common/build_info.txt.in b/Source/Core/Common/build_info.txt.in new file mode 100644 index 0000000000..3ae938cfc5 --- /dev/null +++ b/Source/Core/Common/build_info.txt.in @@ -0,0 +1,24 @@ +// Indicate the minimum OS version required for the binary to run properly. +// Updater will fail the update if the user does not meet this requirement. +OSMinimumVersionWin10=10.0.15063.0 +OSMinimumVersionWin11=10.0.22000.0 +OSMinimumVersionMacOS=10.14 + +// This is the runtime which was compiled against - providing a way for Updater to detect if update +// is needed before executing this binary. Note that, annoyingly, the version in environment +// variables does not match the "real" version. Consider: +// VersionInfo : File: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Redist\MSVC\14.32.31326\vc_redist.x64.exe +// InternalName: setup +// OriginalFilename: VC_redist.x64.exe +// FileVersion: 14.32.31332.0 +// FileDescription: Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.32.31332 +// Product: Microsoft Visual C++ 2015-2022 Redistributable (x64) - 14.32.31332 +// ProductVersion: 14.32.31332.0 +// Whereas the environment variables look like: +// VCToolsInstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.33.31629\ +// VCToolsRedistDir=C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Redist\MSVC\14.32.31326\ +// VCToolsVersion=14.33.31629 +// We're really looking for "14.32.31332.0" (because that's what will appear in the registry once +// installed), NOT the other values! +VCToolsVersion=${VC_TOOLS_VERSION} +VCToolsUpdateURL=https://aka.ms/vs/17/release/vc_redist.x64.exe |
