winbrew_engines\windows\msix/
install.rs1use anyhow::{Context, Result};
9use std::fs;
10use std::path::Path;
11
12use crate::models::install::engine::{
13 EngineInstallReceipt, EngineKind, EngineMetadata, InstallScope,
14};
15
16use crate::windows_dep::packages::msix_install;
17
18pub(crate) fn install(
24 download_path: &Path,
25 install_dir: &Path,
26 package_name: &str,
27) -> Result<EngineInstallReceipt> {
28 let package_full_name =
29 msix_install(download_path, package_name).context("msix install failed")?;
30
31 fs::create_dir_all(install_dir)
32 .with_context(|| format!("failed to create {}", install_dir.display()))?;
33
34 let engine_metadata = Some(EngineMetadata::msix(
35 package_full_name,
36 InstallScope::Installed,
37 ));
38
39 Ok(EngineInstallReceipt::new(
40 EngineKind::Msix,
41 install_dir.to_string_lossy().into_owned(),
42 engine_metadata,
43 ))
44}