Anyone know how to get a third party application's installation directory?

You actually can do it in different ways...
1. using the WMI class

Private Sub GetInstalledProducsByWindowsInstaller() 'need Imports System.Management and its needed reference
        Try
            Dim moc As ManagementObjectCollection
            Dim mos As ManagementObjectSearcher
            Dim mo As ManagementObject

            mos = New ManagementObjectSearcher("Select * from Win32_Product WHERE Name = 'ThirdPartyApp'")
            moc = mos.Get
            For Each mo In moc
                Dim Result As String = String.Format(" {0} {1} {2} {3} {4} ", _
                mo("Name"), " = ", _
                DateTime.ParseExact(mo("InstallDate").ToString(), "yyyyMMdd", Nothing).ToShortDateString(), _
                " = ", mo("InstallLocation"))
                Debug.writeline(Result)
            Next
        Catch ex As Exception
            Debug.writeline(ex.Message)
        End Try
    End Sub

2. using the process class (if the process is running)

Sub GetProcessInfo()
		Dim proc() As Process = Process.GetProcessesByName("explorer")	  'thirdPartyApp
		If proc.Count <> 0 Then
			Debug.WriteLine(IO.Path.GetDirectoryName(proc(0).MainModule.FileName))
		End If
	End Sub

3. reading the desired registry locations such as:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Uninstall

Edited 6 Years Ago by GeekByChoiCe: n/a

Comments
Perfect answer

Awesome information!!! I couldn't find anything this afternoon on this. Thank you so much.

This article has been dead for over six months. Start a new discussion instead.