Servicing for hostpolicy
This commit is contained in:
parent
482f36d26b
commit
0fec9842df
4 changed files with 26 additions and 36 deletions
|
@ -198,9 +198,9 @@ void deps_resolver_t::setup_probe_config(
|
|||
}
|
||||
|
||||
// Servicing normal probe.
|
||||
pal::string_t msil = args.dotnet_extensions;
|
||||
append_path(&msil, _X("msil"));
|
||||
m_probes.push_back(probe_config_t::svc(msil, false, false));
|
||||
pal::string_t ext_pkgs = args.dotnet_extensions;
|
||||
append_path(&ext_pkgs, _X("pkgs"));
|
||||
m_probes.push_back(probe_config_t::svc(ext_pkgs, false, false));
|
||||
}
|
||||
|
||||
if (pal::directory_exists(args.dotnet_packages_cache))
|
||||
|
|
|
@ -378,24 +378,32 @@ int fx_muxer_t::read_config_and_execute(
|
|||
trace::verbose(_X("Executing as a portable app as per config file [%s]"), config_file.c_str());
|
||||
pal::string_t fx_dir = (mode == host_mode_t::split_fx) ? own_dir : resolve_fx_dir(own_dir, &config);
|
||||
corehost_init_t init(deps_file, probe_paths, fx_dir, mode, config);
|
||||
return execute_app(fx_dir, &init, new_argc, new_argv);
|
||||
|
||||
pal::string_t impl_dir;
|
||||
|
||||
// First lookup hostpolicy.dll in servicing with the version of hostpolicy.dll that was compiled lock step with hostfxr.
|
||||
if (!hostpolicy_exists_in_svc(&impl_dir))
|
||||
{
|
||||
impl_dir = fx_dir;
|
||||
}
|
||||
return execute_app(impl_dir, &init, new_argc, new_argv);
|
||||
}
|
||||
else
|
||||
{
|
||||
pal::string_t impl_dir;
|
||||
trace::verbose(_X("Executing as a standalone app as per config file [%s]"), config_file.c_str());
|
||||
if (mode == host_mode_t::standalone)
|
||||
|
||||
// First lookup hostpolicy.dll in servicing with the version of hostpolicy.dll that was compiled lock step with hostfxr.
|
||||
if (!hostpolicy_exists_in_svc(&impl_dir))
|
||||
{
|
||||
pal::string_t svc_dir;
|
||||
impl_dir = hostpolicy_exists_in_svc(&svc_dir) ? svc_dir : own_dir;
|
||||
}
|
||||
else if (mode == host_mode_t::split_fx)
|
||||
{
|
||||
impl_dir = own_dir;
|
||||
}
|
||||
else if (mode == host_mode_t::muxer)
|
||||
{
|
||||
impl_dir = get_directory(app_or_deps);
|
||||
if (mode == host_mode_t::standalone || mode == host_mode_t::split_fx)
|
||||
{
|
||||
impl_dir = own_dir;
|
||||
}
|
||||
else if (mode == host_mode_t::muxer)
|
||||
{
|
||||
impl_dir = get_directory(app_or_deps);
|
||||
}
|
||||
}
|
||||
trace::verbose(_X("The host impl directory before probing deps is [%s]"), impl_dir.c_str());
|
||||
if (!library_exists_in_dir(impl_dir, LIBHOSTPOLICY_NAME, nullptr) && !probe_paths.empty() && !deps_file.empty())
|
||||
|
|
|
@ -87,15 +87,9 @@ bool hostpolicy_exists_in_svc(pal::string_t* resolved_dir)
|
|||
{
|
||||
pal::string_t svc_dir;
|
||||
pal::get_default_extensions_directory(&svc_dir);
|
||||
append_path(&svc_dir, _X("pkgs"));
|
||||
|
||||
pal::string_t version = _STRINGIFY(HOST_POLICY_PKG_VER);
|
||||
|
||||
fx_ver_t lib_ver(-1, -1, -1);
|
||||
if (!fx_ver_t::parse(version, &lib_ver, false))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
pal::string_t rel_dir = _STRINGIFY(HOST_POLICY_PKG_REL_DIR);
|
||||
if (DIR_SEPARATOR != '/')
|
||||
{
|
||||
|
@ -104,19 +98,7 @@ bool hostpolicy_exists_in_svc(pal::string_t* resolved_dir)
|
|||
|
||||
pal::string_t path = svc_dir;
|
||||
append_path(&path, _STRINGIFY(HOST_POLICY_PKG_NAME));
|
||||
|
||||
pal::string_t max_ver;
|
||||
if (lib_ver.is_prerelease())
|
||||
{
|
||||
try_prerelease_roll_forward_in_dir(path, lib_ver, &max_ver);
|
||||
}
|
||||
else
|
||||
{
|
||||
try_patch_roll_forward_in_dir(path, lib_ver, &max_ver);
|
||||
}
|
||||
|
||||
|
||||
append_path(&path, max_ver.c_str());
|
||||
append_path(&path, version.c_str());
|
||||
append_path(&path, rel_dir.c_str());
|
||||
|
||||
if (library_exists_in_dir(path, LIBHOSTPOLICY_NAME, nullptr))
|
||||
|
|
|
@ -71,5 +71,5 @@ if(${CLI_CMAKE_PKG_RID} STREQUAL "")
|
|||
message(FATAL_ERROR "A minimum supported package rid is not specified (ex: win7-x86 or ubuntu.14.04-x64, osx.10.10-x64, rhel.7-x64)")
|
||||
endif()
|
||||
|
||||
add_definitions(-DHOST_POLICY_PKG_NAME="Microsoft.NETCore.DotNetHostPolicy")
|
||||
add_definitions(-DHOST_POLICY_PKG_NAME="runtime.${CLI_CMAKE_PKG_RID}.Microsoft.NETCore.DotNetHostPolicy")
|
||||
add_definitions(-DHOST_POLICY_PKG_REL_DIR="runtimes/${CLI_CMAKE_PKG_RID}/native")
|
||||
|
|
Loading…
Reference in a new issue