diff --git a/.gitignore b/.gitignore index 06e6743..c5997ac 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ /release-out /release-build /tools -/PineFlash_Installer.exe \ No newline at end of file +/PineFlash_Installer.exe +/pineflash* \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 64d81a0..b32f54c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1554,7 +1554,7 @@ checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "pineflash" -version = "0.4.5" +version = "0.4.7" dependencies = [ "confy", "eframe", diff --git a/Cargo.toml b/Cargo.toml index 9a7a314..6342b5b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pineflash" -version = "0.4.5" +version = "0.4.7" edition = "2021" build = "build.rs" diff --git a/Package_Windows_Release.iss b/Package_Windows_Release.iss index 7736d9f..398a587 100644 --- a/Package_Windows_Release.iss +++ b/Package_Windows_Release.iss @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "PineFlash" -#define MyAppVersion "0.4.5" +#define MyAppVersion "0.4.7" #define MyAppPublisher "Spagett" #define MyAppURL "https://github.com/Spagett1" #define MyAppExeName "pineflash.exe" diff --git a/src/submodules/flash.rs b/src/submodules/flash.rs index 6faa063..6c01239 100644 --- a/src/submodules/flash.rs +++ b/src/submodules/flash.rs @@ -5,15 +5,6 @@ use std::io::{Read, Cursor}; use std::path::PathBuf; #[cfg(target_os = "windows")] use std::os::windows::process::CommandExt; -#[cfg(target_family = "unix")] -static DFU_COMMAND: &str = "dfu-util"; -#[cfg(target_family = "unix")] -static BLISP_COMMAND: &str = "blisp"; -#[cfg(target_os = "windows")] -static DFU_COMMAND: &str = "dfu-util.exe"; -#[cfg(target_os = "windows")] -static BLISP_COMMAND: &str = "blisp.exe"; - use crate::Flasher; @@ -57,21 +48,23 @@ impl Flasher { #[cfg(target_os = "linux")] let command = Command::new("pkexec") - .arg(DFU_COMMAND) + .arg("dfu-util") .arg("-D") .arg(firmware_path) .output() .expect("Could not flash soldering iron"); #[cfg(target_os = "macos")] - let command = Command::new(DFU_COMMAND) + let command = Command::new("dfu-util") .arg("-D") .arg(firmware_path) .output() .expect("Could not flash soldering iron"); #[cfg(target_os = "windows")] - let command = Command::new(DFU_COMMAND) + let command: PathBuf = [ std::env::current_dir().unwrap(), "tools".into(), "dfu-util.exe".into() ].iter().collect(); + #[cfg(target_os = "windows")] + let command = Command::new(command) .creation_flags(0x00000008) .arg("-D") .arg(firmware_path) @@ -91,7 +84,7 @@ impl Flasher { } else if self.config.int_name == "Pinecilv2" { #[cfg(target_os = "linux")] let command = Command::new("pkexec") - .arg(BLISP_COMMAND) + .arg("blisp") .arg("write") .arg("-c") .arg("bl70x") @@ -103,7 +96,7 @@ impl Flasher { .expect("Could not flash soldering iron"); #[cfg(target_os = "macos")] - let command = Command::new(BLISP_COMMAND) + let command = Command::new("blisp") .arg("write") .arg("-c") .arg("bl70x") @@ -115,7 +108,7 @@ impl Flasher { .expect("Could not flash soldering iron"); #[cfg(target_family = "windows")] - let command: PathBuf = [ std::env::current_dir().unwrap(), "tools".into(), BLISP_COMMAND.into() ].iter().collect(); + let command: PathBuf = [ std::env::current_dir().unwrap(), "tools".into(), "blisp.exe".into() ].iter().collect(); #[cfg(target_os = "windows")] let command = Command::new(command) diff --git a/src/submodules/main_panel.rs b/src/submodules/main_panel.rs index 6054d95..27aad02 100644 --- a/src/submodules/main_panel.rs +++ b/src/submodules/main_panel.rs @@ -91,14 +91,14 @@ impl Flasher { }); - if self.config.picked_path.is_some() || //&& - // self.config.iron_connected.as_ref() == Some(&self.config.int_name) || - // self.config.iron_connected.as_ref() == Some(&"Both".to_string()) || + if self.config.picked_path.is_some() && + self.config.iron_connected.as_ref() == Some(&self.config.int_name) || + self.config.iron_connected.as_ref() == Some(&"Both".to_string()) || self.config.version != *"Custom" && self.config.version != *"Select" && - !self.config.download //&& - // self.config.iron_connected.as_ref() == Some(&self.config.int_name) || - // self.config.iron_connected.as_ref() == Some(&"Both".to_string()) + !self.config.download && + self.config.iron_connected.as_ref() == Some(&self.config.int_name) || + self.config.iron_connected.as_ref() == Some(&"Both".to_string()) { self.config.ready_to_flash = true