Closed blacklion closed 6 years ago
From Fireice-uk on reddit
It depends. You can compile it not to ask (-DWIN_UAC=OFF) but it is needed for giving you rights to large pages (all systems, one off) and for large page allocation (Windows 7, all the time unless you set memory to slow).
So, offical build is built with UAC and there are no way to make it command line option? It is pity :-(
Yup not at the moment at least.
Compilation documentation says «On Windows 10 it is only needed once to set up the account to use them.», but it asks every time.
For now just compile it to get around this
The problem is that it is not possible to pop up the UAC only once :-( As @Clintoxen wrote if you compile it by your own you can disable the UAC requirement.
It is possible, if it is done in code, not by linker options / manifest. For example, FAR Manager (file manager) requests additional privileges only if it really needs them — for example, when you try to delete file which is not belong to you, not on startup.
But for now I'll build my own build, thank you!
@fireice-uk Could you please have an eye to this issue.
I need the admin privileges removed as default.
Soon as this has been fixed then it can be included in MultiPoolMiner.
I see this as a major security concern (the application downloads and exposes a web interface) and if your OS is up to date it is only a one time thing to set this or it can be done manually.
It might be better to make this an optional command line option on launch for legacy support in Windows 7 to do it on every run, and on new OS only as an optional prompt to set the memory permission for you if you want it.
@blacklion If you know how to do it, please link. AFAIK elevation requires launching of a separate process.
Took some time but this script removes default admin rights from an exe file and doesn't require admin rights itself to run:
param([Parameter(Mandatory = $true)][String]$FullPath)
New-Item -Path "HKCU:\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" -Force | New-ItemProperty -Name $FullPath -Value "RunAsInvoker" -Force
@aaronsace thanks! I think if the demand is large enough (which it looks like it will be) we will make a dedicated windows 10 build with UAC off.
I would appreciate it, it would still be nice to have the setup run via a CLI option if the user has launched the app with elevated permissions manually.. Maybe a --setwinpermission or something.
@fireice-uk Yes, you are right. I've studied FAR Manager code (it is Open source now) and found that it starts sub-process and communicate with it via named pipe to perform actions which require elevated privileges. Sorry.
@fireice-uk Maybe we show follow the way notepad++ does. It's restart itselt under Administrator account when privileges is needed.
(Try use notepad++ to save hosts file, it's will ask to restart under Administrator account - If we accept it, UAC will prompt to start a program under Administrative right.)
I decided to recompile to get rid of the UAC requirment so I could run the process under a non-privileged user, however the -WIN_UAC=OFF or -WIN_UAC=ON parameter had no effect on the compiled file, it always had the UAC flag
I ended up commenting out these lines in the CMakeLists.txt to get it to compile without UAC.
#if(WIN_UAC AND CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
# set_property(TARGET xmr-stak PROPERTY LINK_FLAGS "/level='requireAdministrator' /uiAccess='false'")
#endif()
I suspect it has something to do with the COMPILER_ID but didn't bother to look into it as I simply wanted no UAC.
@bagobones : it is cmake, so -DWIN_UAC=OFF / -DWIN_UAC=ON
Thanks I don't build on windows normally.
Info: I am working on a solution to have a runtime parameter for this.
This code `#if(WIN_UAC AND CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
is not in the CmakeLists.txt ... how do I disable it for Windows 10?
Each time I run new xmr-stak on Windows 10 it shows UAC window and ask for Administrator privileges. Previous (xmr-stak-cpu) version works without additional privileges. I have Large Page and memory lock allowed for my user account, so it is not a problem. It is very inconvenient, as I start xmr-stak at login and re-schedule it to IDLE priority. xmr-stak with elevated privileges can not be re-scheduled easily and UAC window on login is kinda suxx.