How to find the installation directory of any application?

  • Thread starter Thread starter Yash
  • Start date Start date
Y

Yash

Hi,

Is there a way to programmatically find out the directory
in which a particular application is installed? I am using
VB .NET. If I want to obtain the path to the directory
where my MS Word 2000 is installed, what exactly do I have
to do?


Thanks
Yash
 
You might try retrieving the path from the registry if you know the version
number (XP in this example):

Dim registry As Microsoft.Win32.Registry
Dim installRoot As String =
registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Office\10.0\Word").GetV
alue("InstallRoot")

You could also use the Windows Installer APIs, but that would be more
complicated. You can find out more about that in the Windows Installer 2.0
SDK.

Patrick Baker - Visual Basic/Deployment Quality Assurance Team
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
 
Back
Top