Repository: tauri-apps/tauri
File: crates/tauri-bundler/src/bundle/windows/msi/mod.rs (Rust)

Code before:
  }

  data.insert("resources", to_json(resources_wix_string));
  data.insert("resource_file_ids", to_json(files_ids));

  let merge_modules = get_merge_modules(settings)?;
  data.insert("merge_modules", to_json(merge_modules));

  // Note: `main_binary_name` is not used in our template but we keep it as it is potentially useful for custom temples
  let main_binary_name = settings.main_binary_name()?;
  data.insert("main_binary_name", to_json(main_binary_name));

  let main_binary = settings.main_binary()?;
  let main_binary_path = settings.binary_path(main_binary);
  data.insert("main_binary_path", to_json(main_binary_path));

  // copy icon from `settings.windows().icon_path` folder to resource folder near msi
  #[allow(deprecated)]
  let icon_path = if settings.windows().icon_path.as_os_str().is_empty() {
    settings.windows().icon_path.clone()
  } else {
    settings
      .icon_files()
      .flatten()
      .find(|i| i.ends_with(".ico"))
      .context("Couldn't find a .ico file")?
  };
  let icon_path = copy_icon(settings, "icon.ico", &icon_path)?;

  data.insert("icon_path", to_json(icon_path));

  let mut fragment_paths = Vec::new();
  let mut handlebars = Handlebars::new();
  handlebars.register_escape_fn(handlebars::no_escape);
  let mut custom_template_path = None;
  let mut enable_elevated_update_task = false;

  if let Some(wix) = &settings.windows().wix {
    data.insert("component_group_refs", to_json(&wix.component_group_refs));
    data.insert("component_refs", to_json(&wix.component_refs));
    data.insert("feature_group_refs", to_json(&wix.feature_group_refs));
    data.insert("feature_refs", to_json(&wix.feature_refs));
    data.insert("merge_refs", to_json(&wix.merge_refs));
    fragment_paths.clone_from(&wix.fragment_paths);
    enable_elevated_update_task = wix.enable_elevated_update_task;
    custom_template_path.clone_from(&wix.template);

    if let Some(banner_path) = &wix.banner_path {
      let filename = banner_path
        .file_name()
        .unwrap()

Review comment (suggestion):
```suggestion
      .context("Couldn't find a .ico icon")?
```

Code after:
  }

  data.insert("resources", to_json(resources_wix_string));
  data.insert("resource_file_ids", to_json(files_ids));

  let merge_modules = get_merge_modules(settings)?;
  data.insert("merge_modules", to_json(merge_modules));

  // Note: `main_binary_name` is not used in our template but we keep it as it is potentially useful for custom temples
  let main_binary_name = settings.main_binary_name()?;
  data.insert("main_binary_name", to_json(main_binary_name));

  let main_binary = settings.main_binary()?;
  let main_binary_path = settings.binary_path(main_binary);
  data.insert("main_binary_path", to_json(main_binary_path));

  // copy icon from `settings.windows().icon_path` folder to resource folder near msi
  #[allow(deprecated)]
  let icon_path = if !settings.windows().icon_path.as_os_str().is_empty() {
    settings.windows().icon_path.clone()
  } else {
    settings
      .icon_files()
      .flatten()
      .find(|i| i.ends_with(".ico"))
      .context("Couldn't find a .ico icon")?
  };
  let icon_path = copy_icon(settings, "icon.ico", &icon_path)?;

  data.insert("icon_path", to_json(icon_path));

  let mut fragment_paths = Vec::new();
  let mut handlebars = Handlebars::new();
  handlebars.register_escape_fn(handlebars::no_escape);
  let mut custom_template_path = None;
  let mut enable_elevated_update_task = false;

  if let Some(wix) = &settings.windows().wix {
    data.insert("component_group_refs", to_json(&wix.component_group_refs));
    data.insert("component_refs", to_json(&wix.component_refs));
    data.insert("feature_group_refs", to_json(&wix.feature_group_refs));
    data.insert("feature_refs", to_json(&wix.feature_refs));
    data.insert("merge_refs", to_json(&wix.merge_refs));
    fragment_paths.clone_from(&wix.fragment_paths);
    enable_elevated_update_task = wix.enable_elevated_update_task;
    custom_template_path.clone_from(&wix.template);

    if let Some(banner_path) = &wix.banner_path {
      let filename = banner_path
        .file_name()
        .unwrap()