package dkml-install-runner
Module Dkml_install_runner.Cmdliner_runnerSource
val help :
([> `Pager ] as 'a) ->
string list ->
string option ->
[> `Error of bool * string | `Help of 'a * string option | `Ok of unit ]val setup_log :
Fmt.style_renderer option ->
Logs.level option ->
Dkml_install_api.Log_config.tval create_context :
staging_default:Path_location.staging_default ->
target_abi:Dkml_install_api.Context.Abi_v2.t ->
string ->
Dkml_install_register.Component_registry.t ->
Dkml_install_api.Log_config.t ->
string ->
string option ->
string option ->
Dkml_install_api.Context.t Dkml_install_api.Forward_progress.tval raw_dir :
(string ->
[> `Error of string | `Ok of string ])
* (Format.formatter ->
string ->
unit)Directory containing dkml-package-setup.bc or whatever executable (perhaps a renamed setup.exe in a non-bin folder) is currently running.
The root directory that was uncompressed at end-user install time
staging_default_dir_for_package ~archive_dir. For the benefit of Windows and macOS we keep the directory name ("sg") small.
static_default_dir_for_package ~archive_dir. For the benefit of Windows and macOS we keep the directory name ("st") small.
val staging_files_source_for_package_t :
Path_location.staging_files_source Dkml_install_api.Forward_progress.t Term.tstaging_files_source_for_package_t is the setup.exe/uninstall.exe Term.t for the staging files directory. It defaults to the sibling directory "staging".
val static_files_source_for_package_t :
Path_location.static_files_source Dkml_install_api.Forward_progress.t Term.tstatic_files_source_for_package_t is the setup.exe/uninstall.exe Term.t for the static files directory. It defaults to the sibling directory "static".
val unwrap_progress_t :
default:'a ->
'a Dkml_install_api.Forward_progress.t Term.t ->
'a Term.tval ctx_for_runner_t :
target_abi:Dkml_install_api.Context.Abi_v2.t ->
string ->
Dkml_install_register.Component_registry.t ->
Dkml_install_api.Context.t Term.tctx_for_runner_t component_name reg creates a user.exe/admin.exe Term for component component_name that sets up logging and any other global state, and defines the context record.
The package (setup.exe/uninstall.exe) will typically use sudo on Unix or gsudo on Windows to elevate the privileges of `admin.exe`. However it is very unlikely that the environment variables are propagated from the user (setup.exe) to the elevated process (admin.exe). So the staging directory must be specified (`No_staging_default`) when the runner user.exe/admin.exe is launched.
That is, the user process setup.exe can pass its environment variable OPAM_SWITCH_PREFIX (if specified with the no argument `--opam-context` option of setup.exe) into the staging directory argument for admin.exe.
val ctx_for_package_t :
target_abi:Dkml_install_api.Context.Abi_v2.t ->
string ->
Dkml_install_register.Component_registry.t ->
Dkml_install_api.Context.t Term.tctx_for_package_t component_name reg creates a setup.exe/uninstall.exe Term for component component_name that sets up logging and any other global state, and defines the context record.
Unlike ctx_for_runner_t the expectation is that setup.exe/uninstall.exe will be directly launched by the user and have access to the user's environment variables, especially OPAM_SWITCH_PREFIX. So the no argument --opam-context option of setup.exe can default to OPAM_SWITCH_PREFIX.
Unlike ctx_for_runner_t the staging directory has a default (`Staging_default_dir`) based on relative paths from setup.exe.
val common_runner_args :
log_config:Dkml_install_api.Log_config.t ->
prefix:Fpath.t ->
staging_files_source:Path_location.staging_files_source ->
Bos.Cmd.tval eval_progress :
(unit Dkml_install_api.Forward_progress.t Term.t * Term.info) ->
[> `Error of [ `Exn | `Parse | `Term ] | `Help | `Ok of unit | `Version ]