diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-09-14 15:45:32 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-09-14 15:45:32 -0700 |
| commit | 6363910319a082512179269fb6329ecbc367b3bc (patch) | |
| tree | c5325e3fe09ddd81c05ce0b2f109122fa3942cab /toolsrc/src/commands_edit.cpp | |
| parent | 8339f29df5fb5657cdeeb2b8eaa4f48d7d08a0c2 (diff) | |
| download | vcpkg-6363910319a082512179269fb6329ecbc367b3bc.tar.gz vcpkg-6363910319a082512179269fb6329ecbc367b3bc.zip | |
`vcpkg edit`: Improve detection for VSCode - Insiders. Prefer it if available
Diffstat (limited to 'toolsrc/src/commands_edit.cpp')
| -rw-r--r-- | toolsrc/src/commands_edit.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/toolsrc/src/commands_edit.cpp b/toolsrc/src/commands_edit.cpp index dc28de737..7f400f48b 100644 --- a/toolsrc/src/commands_edit.cpp +++ b/toolsrc/src/commands_edit.cpp @@ -8,11 +8,10 @@ namespace vcpkg::Commands::Edit { static std::vector<fs::path> find_from_registry() { - static const std::array<const wchar_t*, 4> REGKEYS = { + static const std::array<const wchar_t*, 3> REGKEYS = { LR"(SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{C26E74D1-022E-4238-8B9D-1E7564A36CC9}_is1)", - LR"(SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{C26E74D1-022E-4238-8B9D-1E7564A36CC9}_is1)", + LR"(SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1287CAD5-7C8D-410D-88B9-0D1EE4A83FF2}_is1)", LR"(SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{F8A2A208-72B3-4D61-95FC-8A65D340689B}_is1)", - LR"(SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{F8A2A208-72B3-4D61-95FC-8A65D340689B}_is1)", }; std::vector<fs::path> output; @@ -23,8 +22,8 @@ namespace vcpkg::Commands::Edit if (const auto c = code_installpath.get()) { const fs::path install_path = fs::path(*c); - output.push_back(install_path / "Code.exe"); output.push_back(install_path / "Code - Insiders.exe"); + output.push_back(install_path / "Code.exe"); } } return output; @@ -34,6 +33,9 @@ namespace vcpkg::Commands::Edit { static const std::string OPTION_BUILDTREES = "--buildtrees"; + 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 Insiders"} / "Code - Insiders.exe"; + auto& fs = paths.get_filesystem(); static const std::string EXAMPLE = Commands::Help::create_example_string("edit zlib"); @@ -48,8 +50,10 @@ namespace vcpkg::Commands::Edit std::vector<fs::path> candidate_paths; const std::vector<fs::path> from_path = Files::find_from_PATH(L"EDITOR"); candidate_paths.insert(candidate_paths.end(), from_path.cbegin(), from_path.cend()); - candidate_paths.push_back(System::get_program_files_platform_bitness() / "Microsoft VS Code" / "Code.exe"); - candidate_paths.push_back(System::get_program_files_32_bit() / "Microsoft VS Code" / "Code.exe"); + candidate_paths.push_back(System::get_program_files_platform_bitness() / VS_CODE_INSIDERS); + candidate_paths.push_back(System::get_program_files_32_bit() / VS_CODE_INSIDERS); + candidate_paths.push_back(System::get_program_files_platform_bitness() / VS_CODE); + candidate_paths.push_back(System::get_program_files_32_bit() / VS_CODE); const std::vector<fs::path> from_registry = find_from_registry(); candidate_paths.insert(candidate_paths.end(), from_registry.cbegin(), from_registry.cend()); |
