diff options
author | psychocrypt <psychocryptHPC@gmail.com> | 2017-12-26 23:37:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-26 23:37:38 +0100 |
commit | 85edb88f2919eaba4a44fad372229a144fffa868 (patch) | |
tree | 2e39df6dc5c41e2e359f62bd79a9cf5846966236 /xmrstak/cli/cli-miner.cpp | |
parent | 756466de67907ab4bcfdd1b0235c14b585f62347 (diff) | |
parent | b216f39a52d87e48b2399da5e3272a9a464ac359 (diff) | |
download | xmr-stak-85edb88f2919eaba4a44fad372229a144fffa868.zip xmr-stak-85edb88f2919eaba4a44fad372229a144fffa868.tar.gz |
Merge pull request #702 from fireice-uk/topic-on-demand-elevation
On-demand elevation
Diffstat (limited to 'xmrstak/cli/cli-miner.cpp')
-rw-r--r-- | xmrstak/cli/cli-miner.cpp | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp index 077d463..7dc0f2f 100644 --- a/xmrstak/cli/cli-miner.cpp +++ b/xmrstak/cli/cli-miner.cpp @@ -368,7 +368,14 @@ int main(int argc, char *argv[]) params::inst().executablePrefix += seperator; } - bool uacDialog = true; + params::inst().minerArg0 = argv[0]; + params::inst().minerArgs.reserve(argc * 16); + for(int i = 1; i < argc; i++) + { + params::inst().minerArgs += " "; + params::inst().minerArgs += argv[i]; + } + bool pool_url_set = false; for(size_t i = 1; i < argc-1; i++) { @@ -554,7 +561,7 @@ int main(int argc, char *argv[]) } else if(opName.compare("--noUAC") == 0) { - uacDialog = false; + params::inst().allowUAC = false; } else { @@ -564,20 +571,6 @@ int main(int argc, char *argv[]) } } -#ifdef _WIN32 - if(uacDialog && !IsElevated()) - { - std::string minerArgs; - for(int i = 1; i < argc; i++) - { - minerArgs += " "; - minerArgs += argv[i]; - } - - SelfElevate(argv[0], minerArgs); - } -#endif - // check if we need a guided start if(!configEditor::file_exist(params::inst().configFile)) do_guided_config(); @@ -588,6 +581,15 @@ int main(int argc, char *argv[]) return 1; } +#ifdef _WIN32 + /* For Windows 7 and 8 request elevation at all times unless we are using slow memory */ + if(jconf::inst()->GetSlowMemSetting() != jconf::slow_mem_cfg::always_use && !IsWindows10OrNewer()) + { + printer::inst()->print_msg(L0, "Elevating due to Windows 7 or 8. You need Windows 10 to use fast memory without UAC elevation."); + RequestElevation(); + } +#endif + if (!BackendConnector::self_test()) { win_exit(); |