Link to home
Create AccountLog in
Avatar of ofern01
ofern01Flag for United States of America

asked on

How can I Detect software installed in a client machine

VS2005
I have a Form that Requires the user to have a couple of applications installed. Is there a way for me to detect if the application is install at the client? is there a way for me to detect if the application is running?

I'm open to any anything to resolve this, so anything will be very helpfull
Thanks....
Avatar of kouroshparsa
kouroshparsa
Flag of Canada image

Below is a complete code I wrote...
Note: some programs do not have a displayName. but most valid software tools do.
In the program below, the disName is what you want to look at.
I have added 2 columns to a listview in the GUI, and set the properties:
listview1.view=details
etc
but you may as well use a listbox or textbox...

cheers
Option Explicit On
Imports Microsoft.Win32
'Created by Kourosh Parsa
 
Public Class Form1
 
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim path As String = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
        Dim objParent As RegistryKey
        Dim objSubkey As RegistryKey
 
        Try
            objParent = Registry.LocalMachine
            objSubkey = objParent.OpenSubKey(path, False)
 
            Dim subNames As String() = objSubkey.GetSubKeyNames()
            For Each str As String In subNames
                Dim disName As String = ""
                Dim item As RegistryKey = Registry.LocalMachine.OpenSubKey(path + "\" & str)
                If Not item.GetValue("DisplayName", "") Is "" Then
                    ' DisplayName is the name of the program installed.
                    DisName = (CType(item.GetValue("DisplayName", ""), String))
                End If
 
                ListView1.Items.Add(disName).SubItems.Add(path & "\" & str)
            Next
 
 
        Catch ex As Exception
            MsgBox("Error" & vbNewLine & ex.Message)
        End Try
 
    End Sub
End Class

Open in new window

To detect if the application is running, you can use the Process class's GetProcessesByName() method
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.getprocessesbyname(VS.80).aspx 
Avatar of ofern01

ASKER

This Looks fine for a Windows app, but It will not work for a client. My app is a web app (ASP.NET). Do you have anything for doing this but on the client side?
 
ASKER CERTIFIED SOLUTION
Avatar of graye
graye
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Avatar of ofern01

ASKER

But still I have to depend on the client to allow this to access the register.
Is there anything else that allows me to check for a program installed on the client. maybe using javascript?
If there is nothing, How are handling this so that it does not crash?
Avatar of ofern01

ASKER

Anything else?