fn run_candle(
  settings: &Settings,
  wix_toolset_path: &Path,
  build_path: &Path,
  wxs_file_name: &str,
) -> crate::Result<()> {
  let arch = match settings.binary_arch() {
    "x86_64" => "x64",
    "x86" => "x86",
    target => {
      return Err(crate::Error::ArchError(format!(
        "unsupported target: {}",
        target
      )))
    }
  };

  let main_binary = settings
    .binaries()
    .iter()
    .find(|bin| bin.main())
    .ok_or_else(|| anyhow::anyhow!("Failed to get main binary"))?;

  let args = vec![
    "-arch".to_string(),
    arch.to_string(),
    wxs_file_name.to_string(),
    format!(
      "-dSourceDir={}",
      settings.binary_path(main_binary).display()
    ),
  ];

  let candle_exe = wix_toolset_path.join("candle.exe");
  common::print_info(format!("running candle for {}", wxs_file_name).as_str())?;

  let mut cmd = Command::new(&candle_exe);
  cmd
    .args(&args)
    .stdout(Stdio::piped())
    .current_dir(build_path);

  common::print_info("running candle.exe")?;
  common::execute_with_verbosity(&mut cmd, &settings).map_err(|_| {
    crate::Error::ShellScriptError(format!(
      "error running candle.exe{}",
      if settings.is_verbose() {
        ""
      } else {
        ", try running with --verbose to see command output"
      }
    ))
  })
}
/// Runs the Candle.exe executable for Wix. Candle parses the wxs file and generates the code for building the installer.
Runs the Candle.exe executable for Wix. Candle parses the wxs file and generates the code for building the installer.
Runs the Candle . exe executable for Wix . Candle parses the wxs file and generates the code for building the installer .
fn run_candle(
  settings: &Settings,
  wix_toolset_path: &Path,
  build_path: &Path,
  wxs_file_name: &str,
) -> crate::Result<()> {
  let arch = match settings.binary_arch() {
    "x86_64" => "x64",
    "x86" => "x86",
    target => {
      return Err(crate::Error::ArchError(format!(
        "unsupported target: {}",
        target
      )))
    }
  };
  let main_binary = settings
    .binaries()
    .iter()
    .find(|bin| bin.main())
    .ok_or_else(|| anyhow::anyhow!("Failed to get main binary"))?;
  let args = vec![
    "-arch".to_string(),
    arch.to_string(),
    wxs_file_name.to_string(),
    format!(
      "-dSourceDir={}",
      settings.binary_path(main_binary).display()
    ),
  ];
  let candle_exe = wix_toolset_path.join("candle.exe");
  common::print_info(format!("running candle for {}", wxs_file_name).as_str())?;
  let mut cmd = Command::new(&candle_exe);
  cmd
    .args(&args)
    .stdout(Stdio::piped())
    .current_dir(build_path);
  common::print_info("running candle.exe")?;
  common::execute_with_verbosity(&mut cmd, &settings).map_err(|_| {
    crate::Error::ShellScriptError(format!(
      "error running candle.exe{}",
      if settings.is_verbose() {
        ""
      } else {
        ", try running with --verbose to see command output"
      }
    ))
  })
}
fn run_candle ( settings : & Settings , wix_toolset_path : & Path , build_path : & Path , wxs_file_name : & str , ) -> crate :: Result < ( ) > { let arch = match settings . binary_arch ( ) { " " => " " , " " => " " , target => { return Err ( crate :: Error :: ArchError ( format ! ( " " target ) ) ) } } ; let main_binary = settings . binaries ( ) . iter ( ) . find ( | bin | bin . main ( ) ) . ok_or_else ( | | anyhow :: anyhow ! ( " " ) ) ? ; let args = vec ! [ " " to_string ( ) arch to_string ( ) wxs_file_name to_string ( ) format ( " " settings binary_path ( main_binary ) display ( ) ) ] ; let candle_exe = wix_toolset_path . join ( " " ) ; common :: print_info ( format ! ( " " wxs_file_name ) . as_str ( ) ) ? ; let mut cmd = Command :: new ( & candle_exe ) ; cmd . args ( & args ) . stdout ( Stdio :: piped ( ) ) . current_dir ( build_path ) ; common :: print_info ( " " ) ? ; common :: execute_with_verbosity ( & mut cmd , & settings ) . map_err ( | _ | { crate :: Error :: ShellScriptError ( format ! ( " " if settings is_verbose ( ) { " " } else { " " } ) ) } ) }
Runs the Candle.exe executable for Wix.
Runs the Candle . exe executable for Wix .
settings
&Settings
wix_toolset_path
&Path
build_path
&Path
wxs_file_name
&str
settings
&Settings
wix_toolset_path
&Path
build_path
&Path
wxs_file_name
&str