access to registry path is denied, can't "run as admin"

asked 2013-06-02 12:54:14 -0500

mtngardener gravatar image

C:\Users\mtngardener>setx -m OPENCV_DIR "c:\Users\mtngardener\built_apps\install\bin" ERROR: Access to the registry path is denied.

This is the same question as a previous poster had, but I can't use the "run as admin" option that was suggested there. However my sysadmin did add the ability for me to run regedit. So I believe I'd be able to make the update to the registry manually. Can someone tell me how to do the equivalent of "setx -m OPENCV_DIR "c:\Users\mtngardener\built_apps\install\bin"" with regedit?

Also, in the answer to the original question it was suggested that "you should use this path for environment variable: D:\OpenCV\Build{platform_type}{compiler_type}, e.g. D:\OpenCV\Build\x64\vc10."

How is this done correctly? By manually moving the files from various directories after the build+install? Or is there a way to configure the build+install to put the files in that directory when "build install" is run?

I am a novice with VS2012 (and any development on Windows) but I have followed: http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html#windows-installation

The documentation is great, but at the "Set the OpenCV enviroment variable and add it to the systems path" step it seems to be missing something. In the previous section it leaves your files in /Build/bin and in this section it wants them in /build/{platform_type}/{compiler}.

edit retag flag offensive close merge delete

Comments

I have the answer, I posted it but I guess I am too new to answer my own question.

Short version is: Add environment variable manually via control panel -> system -> advanced system settings -> environment variables

You also need to add the new %OPENCV_DIR% plus /bin variable you create to you %PATH% or else later on you won't find all your OpenCV DLLs at run time. So add "; %OPENCV_DIR%/bin" to path (leave out the quotes).

mtngardener gravatar imagemtngardener ( 2013-06-02 14:57:33 -0500 )edit

Correction: You should instead add the %OPENCV_DIR% plus /bin variable you create to you %PATH% or else later on you won't find all your OpenCV DLLs at run time. So add "; %OPENCV_DIR%/bin" to path (leave out the quotes).

mtngardener gravatar imagemtngardener ( 2013-06-02 15:19:12 -0500 )edit