[vcpkg] Update hint message
MODIFY
src/vcpkg/build.cpp
src/vcpkg/build.cpp
@@ -1086,12 +1086,18 @@ namespace vcpkg::Build
std::string create_user_troubleshooting_message(const PackageSpec& spec)
{
- return Strings::format("Please ensure you're using the latest portfiles with `.\\vcpkg update`, then\n"
+#if defined(_WIN32)
+ auto vcpkg_update_cmd = ".\\vcpkg";
+#else
+ auto vcpkg_update_cmd = ".\/vcpkg";
+#endif
+ return Strings::format("Please ensure you're using the latest portfiles with `%s update`, then\n"
"submit an issue at https://github.com/Microsoft/vcpkg/issues including:\n"
" Package: %s\n"
" Vcpkg version: %s\n"
"\n"
"Additionally, attach any relevant sections from the log files above.",
+ vcpkg_update_cmd,
spec,
Commands::Version::version());
}

MODIFY
src/vcpkg/commands.version.cpp
src/vcpkg/commands.version.cpp
@@ -61,15 +61,21 @@ namespace vcpkg::Commands::Version
{
if (maj1 != maj2 || min1 != min2 || rev1 != rev2)
{
+#if defined(_WIN32)
+ auto bootstrap = ".\\bootstrap-vcpkg.bat";
+#else
+ auto bootstrap = ".\/bootstrap-vcpkg.sh";
+#endif
System::printf(System::Color::warning,
"Warning: Different source is available for vcpkg (%d.%d.%d -> %d.%d.%d). Use "
- ".\\bootstrap-vcpkg.bat to update.\n",
+ "%s to update.\n",
maj2,
min2,
rev2,
maj1,
min1,
- rev1);
+ rev1,
+ bootstrap);
}
}
}

MODIFY
src/vcpkg/dependencies.cpp
src/vcpkg/dependencies.cpp
@@ -257,13 +257,18 @@ namespace vcpkg::Dependencies
{
ExpectedS<const SourceControlFileLocation&> maybe_scfl =
m_port_provider.get_control_file(ipv.spec().name());
-
+#if defined(_WIN32)
+ auto vcpkg_remove_cmd = ".\\vcpkg";
+#else
+ auto vcpkg_remove_cmd = ".\/vcpkg";
+#endif
if (!maybe_scfl)
Checks::exit_with_message(
VCPKG_LINE_INFO,
- "Error: while loading %s: %s.\nPlease run \"vcpkg remove %s\" and re-attempt.",
+ "Error: while loading %s: %s.\nPlease run \"%s remove %s\" and re-attempt.",
ipv.spec().to_string(),
maybe_scfl.error(),
+ vcpkg_remove_cmd,
ipv.spec().to_string());
return m_graph

MODIFY
src/vcpkg/sourceparagraph.cpp
src/vcpkg/sourceparagraph.cpp
@@ -179,8 +179,12 @@ namespace vcpkg
System::print2("And this is the list of valid fields for manifest files: \n\n ",
Strings::join("\n ", get_list_of_manifest_fields()),
"\n\n");
- System::print2("You may need to update the vcpkg binary; try running bootstrap-vcpkg.bat or "
- "bootstrap-vcpkg.sh to update.\n\n");
+#if defined(_WIN32)
+ auto bootstrap = ".\\bootstrap-vcpkg.bat";
+#else
+ auto bootstrap = ".\/bootstrap-vcpkg.sh";
+#endif
+ System::print2("You may need to update the vcpkg binary; try running %s to update.\n\n", bootstrap);
}
for (auto&& error_info : error_info_list)

MODIFY
src/vcpkg/update.cpp
src/vcpkg/update.cpp
@@ -74,13 +74,21 @@ namespace vcpkg::Update
{
System::printf(" %-32s %s\n", package.spec, package.version_diff.to_string());
}
+
+#if defined(_WIN32)
+ auto vcpkg_cmd = ".\\vcpkg";
+#else
+ auto vcpkg_cmd = ".\/vcpkg";
+#endif
System::print2("\n"
"To update these packages and all dependencies, run\n"
- " .\\vcpkg upgrade\n"
+ " %s upgrade\n"
"\n"
"To only remove outdated packages, run\n"
- " .\\vcpkg remove --outdated\n"
- "\n");
+ " %s remove --outdated\n"
+ "\n",
+ vcpkg_cmd,
+ vcpkg_cmd);
}
Checks::exit_success(VCPKG_LINE_INFO);

[vcpkg] Update hint message (#12976)