mirror of
https://github.com/Cyrix126/gupaxx.git
synced 2024-11-16 15:27:46 +00:00
fix: windows incompatible cmd options for w10 and newer
prevent lowering xmrig priority on windows 10&11
This commit is contained in:
parent
0865fe2ef2
commit
f1229ef914
1 changed files with 16 additions and 12 deletions
|
@ -471,18 +471,22 @@ impl Helper {
|
||||||
info!("XMRig | Entering watchdog mode... woof!");
|
info!("XMRig | Entering watchdog mode... woof!");
|
||||||
// needs xmrig to be in belownormal priority or else Gupaxx will be in trouble if it does not have enough cpu time.
|
// needs xmrig to be in belownormal priority or else Gupaxx will be in trouble if it does not have enough cpu time.
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
std::process::Command::new("cmd")
|
{
|
||||||
.args(["/c", "/q", "wmic"])
|
use std::os::windows::process::CommandExt;
|
||||||
.args([
|
std::process::Command::new("cmd")
|
||||||
"process",
|
.creation_flags(0x08000000)
|
||||||
"where",
|
.args(["/c", "wmic"])
|
||||||
"name='xmrig.exe'",
|
.args([
|
||||||
"CALL",
|
"process",
|
||||||
"setpriority",
|
"where",
|
||||||
"below normal",
|
"name='xmrig.exe'",
|
||||||
])
|
"CALL",
|
||||||
.spawn()
|
"setpriority",
|
||||||
.expect("failure to execute command wmic");
|
"below normal",
|
||||||
|
])
|
||||||
|
.spawn()
|
||||||
|
.expect("failure to execute command wmic");
|
||||||
|
}
|
||||||
loop {
|
loop {
|
||||||
// Set timer
|
// Set timer
|
||||||
let now = Instant::now();
|
let now = Instant::now();
|
||||||
|
|
Loading…
Reference in a new issue