简体   繁体   中英

get full path of an installed program in windows 7 using c++

i want to know that, is there any method to get the full path (where the program is being installed) of an installed program using c++ ? I'm using visual studio 2012 ultimate.

For example, the application (ie the compiled c++ executable) will take the program name as input and return the full installation path of that program!

I would search the hard drive for the said program (providing it's been entered correctly) either in folders names or executables. In particular, you can try by searching the start menu which is located in C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs, but some programs aren't registered in there so you might have to do a full scan.

For this, I would suggest to use boost::filesystem especially for its ease of use and elegancy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM