diff options
Diffstat (limited to 'src/installer/corehost/cli/hostpolicy/args.cpp')
-rw-r--r-- | src/installer/corehost/cli/hostpolicy/args.cpp | 46 |
1 files changed, 3 insertions, 43 deletions
diff --git a/src/installer/corehost/cli/hostpolicy/args.cpp b/src/installer/corehost/cli/hostpolicy/args.cpp index f022d23ae5f..562f70baea8 100644 --- a/src/installer/corehost/cli/hostpolicy/args.cpp +++ b/src/installer/corehost/cli/hostpolicy/args.cpp @@ -4,7 +4,6 @@ #include "args.h" #include <utils.h> -#include "bundle/runner.h" arguments_t::arguments_t() : host_mode(host_mode_t::invalid) @@ -102,47 +101,6 @@ bool parse_arguments( args); } -bool set_root_from_app(const pal::string_t& managed_application_path, - arguments_t& args) -{ - args.managed_application = managed_application_path; - - if (args.managed_application.empty()) - { - // Managed app being empty by itself is not a failure. Host may be initialized from a config file. - assert(args.host_mode != host_mode_t::apphost); - return true; - } - - if (bundle::info_t::is_single_file_bundle()) - { - const bundle::runner_t* app = bundle::runner_t::app(); - args.app_root = app->base_path(); - - // Check for the main app within the bundle. - // locate() sets args.managed_application to the full path of the app extracted to disk. - pal::string_t managed_application_name = get_filename(managed_application_path); - if (app->locate(managed_application_name, args.managed_application)) - { - return true; - } - - trace::info(_X("Managed application [%s] not found in single-file bundle"), managed_application_name.c_str()); - - // If the main assembly is not found in the bundle, continue checking on disk - // for very unlikely case where the main app.dll was itself excluded from the app bundle. - return pal::realpath(&args.managed_application); - } - - if (pal::realpath(&args.managed_application)) - { - args.app_root = get_directory(args.managed_application); - return true; - } - - return false; -} - bool init_arguments( const pal::string_t& managed_application_path, const host_startup_info_t& host_info, @@ -157,11 +115,13 @@ bool init_arguments( args.host_path = host_info.host_path; args.additional_deps_serialized = additional_deps_serialized; - if (!set_root_from_app(managed_application_path, args)) + args.managed_application = managed_application_path; + if (!args.managed_application.empty() && !pal::realpath(&args.managed_application)) { trace::error(_X("Failed to locate managed application [%s]"), args.managed_application.c_str()); return false; } + args.app_root = get_directory(args.managed_application); if (!deps_file.empty()) { |