diff --git a/win_installer/src/app.rs b/win_installer/src/app.rs index 0a56f54..a430e50 100644 --- a/win_installer/src/app.rs +++ b/win_installer/src/app.rs @@ -195,7 +195,7 @@ impl App { // Get image info let wim_sources = self.state.wim_sources.lock().unwrap(); let wim_file = wim_sources.get_file(self.state.wim_file_index.unwrap()); - let wim_index = format!("{}", self.state.wim_image_index.unwrap()); + let wim_index = self.state.wim_image_index.unwrap() + 1; // wimapply uses 1-based index // Add actions let disk_list = self.state.disk_list.lock().unwrap(); @@ -206,7 +206,12 @@ impl App { let dest_path = format!("{}:\\", disk.get_part_letter(num_parts - 1)); self.tasks.add(TaskType::CommandWait( wimlib_imagex, - vec![String::from("apply"), wim_file.path, wim_index, dest_path], + vec![ + String::from("apply"), + wim_file.path, + format!("{wim_index}"), + dest_path, + ], )); } } diff --git a/win_installer/src/wim.rs b/win_installer/src/wim.rs index 6abfe8b..bdb5bca 100644 --- a/win_installer/src/wim.rs +++ b/win_installer/src/wim.rs @@ -176,13 +176,20 @@ impl WimSources { } pub fn get_file(&self, index: usize) -> WimFile { + let rel_index: usize; let num_local = self.local.len(); - let index = if index < num_local { - index + let mut use_local = true; + if index < num_local { + rel_index = index; } else { - index - num_local + rel_index = index - num_local; + use_local = false; }; - self.local.get(index).unwrap().clone() + if use_local { + self.local.get(rel_index).unwrap().clone() + } else { + self.network.get(rel_index).unwrap().clone() + } } pub fn get_file_list(&self) -> Vec {