mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2026-02-05 17:56:53 +01:00
--no-admin and fix migoto setting
This commit is contained in:
@@ -27,7 +27,7 @@
|
|||||||
"test": "react-scripts test",
|
"test": "react-scripts test",
|
||||||
"eject": "react-scripts eject",
|
"eject": "react-scripts eject",
|
||||||
"tauri": "tauri",
|
"tauri": "tauri",
|
||||||
"start:dev": "tauri dev",
|
"start:dev": "tauri dev -- -- --no-admin",
|
||||||
"format": "cargo fmt --manifest-path ./src-tauri/Cargo.toml --all && yarn prettier --write --cache --loglevel warn .",
|
"format": "cargo fmt --manifest-path ./src-tauri/Cargo.toml --all && yarn prettier --write --cache --loglevel warn .",
|
||||||
"lint": "cargo clippy --manifest-path ./src-tauri/Cargo.toml --no-default-features && yarn tsc --noEmit && yarn eslint src",
|
"lint": "cargo clippy --manifest-path ./src-tauri/Cargo.toml --no-default-features && yarn tsc --noEmit && yarn eslint src",
|
||||||
"lint:fix": "cargo clippy --manifest-path ./src-tauri/Cargo.toml --no-default-features --fix --allow-dirty && yarn tsc --noEmit && yarn eslint --fix src",
|
"lint:fix": "cargo clippy --manifest-path ./src-tauri/Cargo.toml --no-default-features --fix --allow-dirty && yarn tsc --noEmit && yarn eslint --fix src",
|
||||||
|
|||||||
@@ -51,7 +51,9 @@ async fn arg_handler(args: &[String]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
if !is_elevated() {
|
let args: Vec<String> = std::env::args().collect();
|
||||||
|
|
||||||
|
if !is_elevated() && !has_arg(&args, "--no-admin") {
|
||||||
println!("===============================================================================");
|
println!("===============================================================================");
|
||||||
println!("You running as a non-elevated user. Some stuff will almost definitely not work.");
|
println!("You running as a non-elevated user. Some stuff will almost definitely not work.");
|
||||||
println!("===============================================================================");
|
println!("===============================================================================");
|
||||||
@@ -69,8 +71,6 @@ fn main() {
|
|||||||
exe_path.pop();
|
exe_path.pop();
|
||||||
std::env::set_current_dir(&exe_path).unwrap();
|
std::env::set_current_dir(&exe_path).unwrap();
|
||||||
|
|
||||||
let args: Vec<String> = std::env::args().collect();
|
|
||||||
|
|
||||||
block_on(arg_handler(&args));
|
block_on(arg_handler(&args));
|
||||||
|
|
||||||
// For disabled GUI
|
// For disabled GUI
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ pub fn set_migoto_target(path: String, migoto_path: String) -> bool {
|
|||||||
// Set options
|
// Set options
|
||||||
conf
|
conf
|
||||||
.with_section(Some("Loader"))
|
.with_section(Some("Loader"))
|
||||||
.set("target", pathbuf.to_str().unwrap());
|
.set("target", pathbuf.file_name().unwrap().to_str().unwrap());
|
||||||
|
|
||||||
// Write file
|
// Write file
|
||||||
match conf.write_to_file(&migoto_pathbuf) {
|
match conf.write_to_file(&migoto_pathbuf) {
|
||||||
|
|||||||
Reference in New Issue
Block a user