mirror of https://github.com/lukechilds/cc-rs.git
Browse Source
After I recently uninstalled some older MSVC versions using Visual Studio Uninstaller (https://github.com/Microsoft/VisualStudioUninstaller), HKLM\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7\15.0 also was deleted in the process, even though Visual Studio 2017 *itself* wasn't, and still worked fine. Steps to reproduce: 1. Install Visual Studio 2017 Community with the *Desktop development with C++* workload on a fresh Windows system. (I tested with version 15.7.6.) 2. Confirm that the registry key points to the installation directory. 3. Run the Visual Studio Uninstaller on that same system. 4. The registry key is now gone, but Visual Studio 2017 IDE still works and can compile code. 5. The following Rust code then runs without panicking: ```rust extern crate cc; use cc::windows_registry::find_tool; fn main() { // Change this if your test system is 32-bit let target = "x86_64-pc-windows-msvc"; assert_eq!(find_tool(target, "devenv.exe").is_none(), true); assert_eq!(find_tool(target, "link.exe").is_some(), true); // msbuild.exe will fall back on find_old_msbuild(), which will // find a ersion under a different registry key. } ``` Which means that `link.exe` can still be found just fine through SetupConfiguration. This may be a bug in Visual Studio Uninstaller, but it also matches what Microsoft says about the reliability of these registry keys, and that SetupConfiguration should be preferred. (See https://developercommunity.visualstudio.com/comments/215399/view.html).wintest
nmlgc
6 years ago
1 changed files with 26 additions and 29 deletions
Loading…
Reference in new issue