2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Merovingian
1

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 by GeekByChoiCe: n/a

Votes + Comments
Perfect answer
0

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

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.