CMAKE Install issue on Vista

6532e3e5e09db6f966770fdf86c03345
0
hellhound_01 104 May 11, 2011 at 08:24

Hello,

actual I’m struggling with CMAKE INSTALL command on Windows Vista, when I try to copy the resulting DLL to the system32 folder using this command:

INSTALL(FILES ${CMAKE_SOURCE_DIR}/lib/lib${LIBRARY_NAME}.dll DESTINATION $ENV{SYSTEMROOT}/System32/) 

On XP this command could be used without any failure. On Vista i got the error message that the dll could not copied. Any suggestions?

Thanks for any hint.
Best regards.

4 Replies

Please log in or register to post a reply.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 May 11, 2011 at 17:44

It’s probably a permissions issue; in Vista / Windows 7 with the default setup you have to elevate to admin privelege level to touch anything on the hard drive outside your own user account directory. Try running the install from a command line with admin privs (typically you can right-click on a shortcut and choose “Run as administrator”).

6532e3e5e09db6f966770fdf86c03345
0
hellhound_01 104 May 12, 2011 at 06:07

I’m running vista generally in administration mode. It seems to me that cmake has not the permission to execute this command running the script from my MSYS/MinGW environment. Is it possible to give cmake those permissions?

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 May 12, 2011 at 06:15

Unfortunately there is no Windows equivalent of “sudo” AFAIK. You have to run the command prompt / shell, or whatever parent process you’re initially launching, with admin privs; then subprocesses will inherit those privs. You still have to explicitly elevate things even if your user account is set up as an admin account. It’s dumb, but that’s the way it is, to date.

6532e3e5e09db6f966770fdf86c03345
0
hellhound_01 104 May 12, 2011 at 06:32

Hmm okay. I will try to start up the mingw environment with admin privileges.
Damn Microsoft didoes … Thanks for your help.