summaryrefslogtreecommitdiffstats
path: root/xmrstak/cli
diff options
context:
space:
mode:
authorfireice-uk <fireice-uk@users.noreply.github.com>2017-12-25 16:36:44 +0000
committerfireice-uk <fireice-uk@users.noreply.github.com>2017-12-25 16:36:44 +0000
commit038a4eb34d40abac8d0242f9ca881b0dac344723 (patch)
tree12ed16c47d2cac7b8af49259c17f4b17bc1caea9 /xmrstak/cli
parent52c305796127258f29d119843e86906541ea27b3 (diff)
downloadxmr-stak-038a4eb34d40abac8d0242f9ca881b0dac344723.zip
xmr-stak-038a4eb34d40abac8d0242f9ca881b0dac344723.tar.gz
On-demand elevation
Diffstat (limited to 'xmrstak/cli')
-rw-r--r--xmrstak/cli/cli-miner.cpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/xmrstak/cli/cli-miner.cpp b/xmrstak/cli/cli-miner.cpp
index b84b783..4904604 100644
--- a/xmrstak/cli/cli-miner.cpp
+++ b/xmrstak/cli/cli-miner.cpp
@@ -342,7 +342,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++)
{
@@ -506,7 +513,7 @@ int main(int argc, char *argv[])
}
else if(opName.compare("--noUAC") == 0)
{
- uacDialog = false;
+ params::inst().allowUAC = false;
}
else
{
@@ -516,20 +523,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();
@@ -540,6 +533,12 @@ 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 && LOBYTE(LOWORD(GetVersion())) < 10)
+ RequestElevation();
+#endif
+
if (!BackendConnector::self_test())
{
win_exit();
OpenPOWER on IntegriCloud