简体   繁体   中英

Getting the installation directory of a given application

I want to know the path of the installation directory of a given application (C++). The application could be any application and not necessarily the application which is being executed...

There are similar questions but everywhere they are talking about the application which is currently loaded.

There is not a common answer for your question.
Different application can have different installation path, and it has different ways to get its installation path.

Below are some suggestions for your reference.

  1. Collect your interesting application, and do research to get their installation path. (most application install path can be retrieved from registry key or common folder)
  2. Generate some pattern that describe how to get installation path by windows API.
  3. use windows API RegQueryValue() and SHGetSpecialFolderPath() to get registry key and common folder.

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