build windows install

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages
2022-10-11 14:52:46 +08:00
parent 2ced73cdda
commit e2924f0d41
6 changed files with 74 additions and 26 deletions

View File

@@ -6,6 +6,7 @@ pub fn core_main() -> Option<Vec<String>> {
// though async logger more efficient, but it also causes more problems, disable it for now
// let mut _async_logger_holder: Option<flexi_logger::LoggerHandle> = None;
let mut args = Vec::new();
let mut flutter_args = Vec::new();
let mut i = 0;
let mut is_setup = false;
let mut _is_elevate = false;
@@ -25,13 +26,18 @@ pub fn core_main() -> Option<Vec<String>> {
}
i += 1;
}
if args.contains(&"--install".to_string()) {
is_setup = true;
}
if is_setup {
if args.is_empty() {
args.push("--install".to_owned());
} else if args[0] == "--noinstall" {
args.clear();
flutter_args.push("--install".to_string());
}
}
if args.contains(&"--noinstall".to_string()) {
args.clear();
}
if args.len() > 0 && args[0] == "--version" {
println!("{}", crate::VERSION);
return None;
@@ -171,7 +177,10 @@ pub fn core_main() -> Option<Vec<String>> {
}
}
//_async_logger_holder.map(|x| x.flush());
Some(args)
#[cfg(feature = "flutter")]
return Some(flutter_args);
#[cfg(not(feature = "flutter"))]
return Some(args);
}
fn import_config(path: &str) {