Dkml_package_console_common
console_component_name
is the name of the component that has executables that help run console installers (like gsudo.exe on Windows to elevate privileges).
console_required_components
are the names of components that console installers require to be present. It always includes console_component_name
but may include other components.
At minimum, these other required components include:
"staging-ocamlrun"
because Dkml_package_console_entry.entry
uses ocamlrun to run the dkml-package.bc bytecode.val needs_install_admin :
reg:Dkml_install_register.Component_registry.t ->
selector:Dkml_install_register.Component_registry.component_selector ->
log_config:Dkml_install_api.Log_config.t ->
target_abi:Dkml_install_api.Context.Abi_v2.t ->
prefix:Fpath.t ->
staging_files_source:Dkml_install_runner.Path_location.staging_files_source ->
bool Dkml_install_api.Forward_progress.t
val needs_uninstall_admin :
reg:Dkml_install_register.Component_registry.t ->
selector:Dkml_install_register.Component_registry.component_selector ->
log_config:Dkml_install_api.Log_config.t ->
target_abi:Dkml_install_api.Context.Abi_v2.t ->
prefix:Fpath.t ->
staging_files_source:Dkml_install_runner.Path_location.staging_files_source ->
bool Dkml_install_api.Forward_progress.t
module Author_types : sig ... end
ver_m_n_o_p ver
converts the version ver
into the "mmmmm.nnnnn.ooooo.ppppp"
format required by an Application Manifest.
Confer https://docs.microsoft.com/en-us/windows/win32/sbscs/application-manifests#assemblyidentity
val spawn :
?err_ok:bool ->
Bos.Cmd.t ->
unit Dkml_install_api.Forward_progress.t
spawn ?err_ok cmd
launches the command cmd
and waits for its response.
Use err_ok = true
if you want to log errors but continue.
val elevated_cmd :
target_abi:Dkml_install_api.Context.Abi_v2.t ->
staging_files_source:Dkml_install_runner.Path_location.staging_files_source ->
Bos.Cmd.t ->
Bos.Cmd.t Dkml_install_api.Forward_progress.t
elevated_cmd ~target_abi ~staging_files_source cmd
translates the command cmd
into a command that elevates privileges using "gsudo.exe"
from the staging files staging_files_source
on Windows machines, or "doas"
, "sudo"
or "su"
on the PATH on Unix machines.
val get_user_installation_prefix :
program_name:Author_types.program_name ->
target_abi:Dkml_install_api__Types.Context.Abi_v2.t ->
prefix_opt:string option ->
Fpath.t Dkml_install_api.Forward_progress.t
get_user_installation_prefix ~program_name ~target_abi ~prefix_opt
returns where user programs should be installed; either the prefix prefix_opt = Some prefix
or uses the platform convention when prefix_opt = None
.
Platform Conventions
The user programs would be installed to these locations by default:
Windows: "$env:LOCALAPPDATA\\Programs\\<name_full>"
when prefer_spaces = False
or "$env:LOCALAPPDATA\\Programs\\<name_camel_case_nospaces>"
otherwise. This pattern closely conforms to the standard established by "$env:LOCALAPPDATA\\Programs\\Microsoft VS Code"
macOS: "~/Applications/<name_full>.app"
when prefer_spaces = False
or "~/Applications/<name_camel_case_nospaces>.app"
otherwise.
Linux: If "$XDG_DATA_HOME"
is defined then "$XDG_DATA_HOME/<name_kebab_lower_case>"
otherwise "$HOME/.local/share/<name_kebab_lower_case>"
type package_args = {
log_config : Dkml_install_api.Log_config.t;
prefix_opt : string option;
component_selector : string list;
static_files_source : Dkml_install_runner.Path_location.static_files_source;
staging_files_source : Dkml_install_runner.Path_location.staging_files_source;
}
Common options between setup.exe and uninstaller.exe
val package_args_t :
program_name:Author_types.program_name ->
target_abi:Dkml_install_api__Types.Context.Abi_v2.t ->
install_direction:
Dkml_install_runner.Path_eval.Global_context.install_direction ->
package_args Cmdliner.Term.t
Cmdliner
.Term.t for the common options between setup.exe and uninstaller.exe
module Windows_registry : sig ... end