cargo-dist 0.32.0

Shippable application packaging for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Code for generating installer.ps1

use axoasset::LocalAsset;

use crate::{backend::templates::TEMPLATE_INSTALLER_PS1, errors::DistResult, DistGraph};

use super::InstallerInfo;

pub(crate) fn write_install_ps_script(dist: &DistGraph, info: &InstallerInfo) -> DistResult<()> {
    let script = dist
        .templates
        .render_file_to_clean_string(TEMPLATE_INSTALLER_PS1, info)?;
    LocalAsset::write_new(&script, &info.dest_path)?;
    dist.signer.sign(&info.dest_path)?;
    Ok(())
}