mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-14 16:14:48 +01:00
--no-admin and fix migoto setting
This commit is contained in:
@@ -51,7 +51,9 @@ async fn arg_handler(args: &[String]) {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
if !is_elevated() {
|
||||
let args: Vec<String> = std::env::args().collect();
|
||||
|
||||
if !is_elevated() && !has_arg(&args, "--no-admin") {
|
||||
println!("===============================================================================");
|
||||
println!("You running as a non-elevated user. Some stuff will almost definitely not work.");
|
||||
println!("===============================================================================");
|
||||
@@ -69,8 +71,6 @@ fn main() {
|
||||
exe_path.pop();
|
||||
std::env::set_current_dir(&exe_path).unwrap();
|
||||
|
||||
let args: Vec<String> = std::env::args().collect();
|
||||
|
||||
block_on(arg_handler(&args));
|
||||
|
||||
// For disabled GUI
|
||||
|
||||
@@ -115,7 +115,7 @@ pub fn set_migoto_target(path: String, migoto_path: String) -> bool {
|
||||
// Set options
|
||||
conf
|
||||
.with_section(Some("Loader"))
|
||||
.set("target", pathbuf.to_str().unwrap());
|
||||
.set("target", pathbuf.file_name().unwrap().to_str().unwrap());
|
||||
|
||||
// Write file
|
||||
match conf.write_to_file(&migoto_pathbuf) {
|
||||
|
||||
Reference in New Issue
Block a user