Update installer script to support UCRT and check for the versions of VS that support UCRT.#745
Update installer script to support UCRT and check for the versions of VS that support UCRT.#745LightBender wants to merge 1 commit into
Conversation
… VS that support UCRT.
| LangString DESC_AddD2ToPath ${LANG_ENGLISH} "Modify the PATH environment variable so DMD can be used from any command prompt" | ||
|
|
||
| LangString DESC_VisualDDownload ${LANG_ENGLISH} "Visual Studio package providing both project management and language services. It works with Visual Studio 2008-2017 (and the free VS Shells)" | ||
| LangString DESC_VisualDDownload ${LANG_ENGLISH} "Visual Studio package providing both project management and language services. It works with Visual Studio 2019 and later" |
There was a problem hiding this comment.
Visual D should still work fine on VS 2012+ (one bug report for VS 2008). If we detect still VS 2015 below, we don't have to be more restrictive here.
There was a problem hiding this comment.
I did remove the below-2015 detection because UCRT is not supported below 2015, and we are talking about an 11 year old version of VS that is entirely unsupported by Microsoft. I can modify the language to say 2015 and later?
There was a problem hiding this comment.
I'm ok with removing support for the old VS versions. I just meant that the description only mentions support for VS2019 or later, but VS2015 and VS2017 are detected below. Maybe just remove the sentence "It works with...".
| !define VS2013Filename "vs_community2013.exe" | ||
| !define VS2017Filename "vs_community2017.exe" | ||
| !define VS2017BTFilename "vs_BuildTools2017.exe" | ||
| !define VS2019Filename "vs_community2019.exe" |
There was a problem hiding this comment.
dmd still comes with a 32-bit executable. VS2019 is the last VS version that runs on a 32-bit system. If we want to support that, we might want to keep that option.
There was a problem hiding this comment.
Does DMD need to be called by a 32-bit version of VS? IIRC this should not be a limitation.
There was a problem hiding this comment.
No, but we install a 32-bit version of dmd to support a 32-bit host-OS. You cannot install VS2022 or VS2026 on that system, though. Either we ignore that, or don't provide the option to install VS on a 32-bit host, or switch to VS2019 in that case.
| StrCpy $1 "VC2026" | ||
| StrCmp $0 "" not_vc2026 vs2026 | ||
| vs2026: | ||
| ${LineRead} "$0\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt" "1" $2 |
There was a problem hiding this comment.
This won't work on your system that misses this file.
There was a problem hiding this comment.
I can probably make it use the same registry based detection used elsewhere. Let me see about that.
There was a problem hiding this comment.
I think you don't need these VS2022/VS2026 detection, DetectVC should be good enough. See also https://github.com/dlang/installer/pull/725/changes#diff-179a67f45668adad5ec8526432aeda299d6c08b4df2bb5349f37489fda1674d4R344
| ClearErrors | ||
| ReadRegStr $0 HKLM "${VCRedistx86RegKey}" "ProductName" | ||
| IfErrors 0 vcredistx86_installed | ||
| ReadRegDWORD $0 HKLM "${VCRedistx86RegKey}" "Installed" |
There was a problem hiding this comment.
Is it possible to detect/install the UCRT only, not the VC redistributable? Might avoid running an extra installation if the UCRT is preinstalled with Win11.
There was a problem hiding this comment.
Not by itself. UCRT is available on all Windows10/11 installs by default, so we can assume it's presence on those, an OS Major Version number would be sufficient, but below those detection is an ... interesting question. One possible route is to look for the existence of C:\Windows\System32\ucrtbase.dll
There was a problem hiding this comment.
I remember installing the UCRT was quite a hassle on Windows 7. Might be ok to just mention that the VC runtime installer should be used on pre-Win10 systems (does it still work there?) and keep the "do nothing" option.
This PR updates the installer to note the use of UCRT and the VS detection logic to look for all versions of VS that support the UCRT.
This PR is paired with dlang/dmd#23345.