vscode-cmake-tools icon indicating copy to clipboard operation
vscode-cmake-tools copied to clipboard

"CMake: Install" command doesn't elevate child process on Windows

Open ohhmm opened this issue 1 year ago • 1 comments

Brief Issue Summary

CMake --install on Windows requires elevation to copy files when prefix points to Program Files folder.

CMake Tools Diagnostics

No response

Debug Log

No response

Additional Information

Here is example output for LevelDB installation: [main] Building folder: leveldb install [build] Starting build [proc] Executing command: "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --build s:/leveldb/build --config Release --target install -- [build] [1/1 0% :: 0.000] Install the project... [build] -- Install configuration: "Release" [build] -- Installing: C:/Program Files (x86)/leveldb/lib/libleveldb.a [build] CMake Error at cmake_install.cmake:44 (file): [build] file INSTALL cannot copy file "S:/leveldb/build/Release/libleveldb.a" to [build] "C:/Program Files (x86)/leveldb/lib/libleveldb.a": Permission denied. [build] [build] [build] FAILED: CMakeFiles/Release/install.util [build] cmd.exe /C "cd /D S:\leveldb\build && "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake" [build] ninja: build stopped: subcommand failed. [proc] The command: "C:\Program Files\Microsoft Visual Studio\2022\Preview\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" --build s:/leveldb/build --config Release --target install -- exited with code: 1 [driver] Build completed: 00:00:00.096 [build] Build finished with exit code 1

ohhmm avatar Dec 30 '23 15:12 ohhmm

@ohhmm This is likely more of an enhancement, marking it as such in the labels. I'll make sure to place it on the backlog for us to investigate when we have bandwidth.

gcampbell-msft avatar Jan 02 '24 20:01 gcampbell-msft