prakhar3agrwal
prakhar3agrwal

Reputation: 346

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.

Upvotes: 0

Views: 655

Answers (1)

Jerry YY Rain
Jerry YY Rain

Reputation: 4382

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.

Upvotes: 1

Related Questions