From b203d4b43cb498aa7670c091b0d10aea456f24ed Mon Sep 17 00:00:00 2001 From: psychocrypt Date: Thu, 30 Nov 2017 22:04:47 +0100 Subject: [PATCH] add environment variable `XMRSTAK_NOWAIT` - add documentation - add environment variable `XMRSTAK_NOWAIT` --- doc/usage.md | 3 +++ xmrstak/cli/cli-miner.cpp | 6 ++++++ xmrstak/misc/console.cpp | 9 +++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/usage.md b/doc/usage.md index a13586f..edd5c89 100644 --- a/doc/usage.md +++ b/doc/usage.md @@ -20,6 +20,9 @@ The number of files depends on the available backends. 1) Double click the `xmr-stak.exe` file 2) Fill in the pool url, username and password +`set XMRSTAK_NOWAIT=1` disable the dialog `Press any key to exit.` for non UAC execution. + + ## Usage on Linux & MacOS 1) Open a terminal within the folder with the binary 2) Start the miner with `./xmr-stak` diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp index e152a02..e32733b 100644 --- a/xmrstak/cli/cli-miner.cpp +++ b/xmrstak/cli/cli-miner.cpp @@ -87,6 +87,12 @@ void help() cout<<" -u, --user USERNAME pool user name or wallet address"<print_str("Press any key to exit."); - get_key(); + size_t envSize = 0; + getenv_s(&envSize, nullptr, 0, "XMRSTAK_NOWAIT"); + if(envSize == 0) + { + printer::inst()->print_str("Press any key to exit."); + get_key(); + } std::exit(code); }