Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xmr-stak requires administrator privileges on Windows 10 #150

Closed
blacklion opened this issue Nov 19, 2017 · 21 comments
Closed

xmr-stak requires administrator privileges on Windows 10 #150

blacklion opened this issue Nov 19, 2017 · 21 comments

Comments

@blacklion
Copy link
Contributor

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.

@ClintOxx
Copy link

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).

@blacklion
Copy link
Contributor Author

So, offical build is built with UAC and there are no way to make it command line option? It is pity :-(

@ClintOxx
Copy link

Yup not at the moment at least.

@blacklion
Copy link
Contributor Author

Compilation documentation says «On Windows 10 it is only needed once to set up the account to use them.», but it asks every time.

@ClintOxx
Copy link

For now just compile it to get around this

@psychocrypt
Copy link
Collaborator

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.

@blacklion
Copy link
Contributor Author

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!

@psychocrypt
Copy link
Collaborator

@fireice-uk Could you please have an eye to this issue.

@aaronsace
Copy link

aaronsace commented Nov 19, 2017

I need the admin privileges removed as default.

Soon as this has been fixed then it can be included in MultiPoolMiner.

@bagobones
Copy link

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.

@fireice-uk
Copy link
Owner

@blacklion If you know how to do it, please link. AFAIK elevation requires launching of a separate process.

@aaronsace
Copy link

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

@fireice-uk
Copy link
Owner

fireice-uk commented Nov 20, 2017

@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.

@bagobones
Copy link

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.

@blacklion
Copy link
Contributor Author

@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.

@anhphan
Copy link

anhphan commented Nov 20, 2017

@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.)

@bagobones
Copy link

bagobones commented Dec 5, 2017

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.

@blacklion
Copy link
Contributor Author

@bagobones : it is cmake, so -DWIN_UAC=OFF / -DWIN_UAC=ON

@bagobones
Copy link

Thanks I don't build on windows normally.

@psychocrypt
Copy link
Collaborator

psychocrypt commented Dec 5, 2017 via email

@thehockeyguy
Copy link

thehockeyguy commented Feb 13, 2018

This code
`#if(WIN_UAC AND CMAKE_CXX_COMPILER_ID MATCHES "MSVC")

set_property(TARGET xmr-stak PROPERTY LINK_FLAGS "/level='requireAdministrator' /uiAccess='false'")

#endif()`

is not in the CmakeLists.txt ... how do I disable it for Windows 10?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants