diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2018-10-04 14:33:54 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2018-10-04 14:39:48 -0700 |
| commit | e8e8c1499858db0bb0a450e86a0f7ace788d3788 (patch) | |
| tree | 34d32773624915716ee56d6ac98b9269925b3198 | |
| parent | 008c5d8668b9a0b42dee249057bac223a3e3f896 (diff) | |
| download | vcpkg-e8e8c1499858db0bb0a450e86a0f7ace788d3788.tar.gz vcpkg-e8e8c1499858db0bb0a450e86a0f7ace788d3788.zip | |
`vcpkg edit` now checks the default user-installer location for VSCode
| -rw-r--r-- | toolsrc/src/vcpkg/commands.edit.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/toolsrc/src/vcpkg/commands.edit.cpp b/toolsrc/src/vcpkg/commands.edit.cpp index 2569c2cea..0b1b348c2 100644 --- a/toolsrc/src/vcpkg/commands.edit.cpp +++ b/toolsrc/src/vcpkg/commands.edit.cpp @@ -92,8 +92,8 @@ namespace vcpkg::Commands::Edit void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - static const fs::path VS_CODE_INSIDERS = fs::path{"Microsoft VS Code Insiders"} / "Code - Insiders.exe"; - static const fs::path VS_CODE = fs::path{"Microsoft VS Code"} / "Code.exe"; + static const fs::path VS_CODE_INSIDERS = fs::path {"Microsoft VS Code Insiders"} / "Code - Insiders.exe"; + static const fs::path VS_CODE = fs::path {"Microsoft VS Code"} / "Code.exe"; auto& fs = paths.get_filesystem(); @@ -128,6 +128,14 @@ namespace vcpkg::Commands::Edit candidate_paths.push_back(*pf / VS_CODE); } + const auto& app_data = System::get_environment_variable("APPDATA"); + if (const auto* ad = app_data.get()) + { + const fs::path default_base = fs::path {*ad}.parent_path() / "Local" / "Programs"; + candidate_paths.push_back(default_base / VS_CODE_INSIDERS); + candidate_paths.push_back(default_base / VS_CODE); + } + const std::vector<fs::path> from_registry = find_from_registry(); candidate_paths.insert(candidate_paths.end(), from_registry.cbegin(), from_registry.cend()); |
