How Check if the latest version of programs are installed RRS feed

  • Question



    I am willing to develop an application which scans the computer to find whether the user has the latest versions of the programs. The application should only scan only the programs that are in my database. If the user doesn't have the latest version it should allow him to download the latest version from my softwate website.

    My Problem:

    1- Where exactly I should scan to find the list of installed programs on the user's computer?

    2- What I should save in my database to compare against for each program?

    Any Ideas.....

    Saturday, November 8, 2008 8:23 AM

All replies

  • Hello,


    Scanning the users hard drive would be a waste of their time and system resources if you already have a database of applications that you support and have updates available for download. Instead of scanning the hard drive I would recommend that you look for each application supported in your database and compare versions directly.


    To acheive this I would suggest looking for registry entries or a particular file, a good example would be a help or read me file which will always be in a static location and contain the version details. Using this method, if you only support a dozen applications, then the application will only search a dozen locations, instead of an entire hard drive contents.


    This sort of gives you an example of how I would answer this problem logically (demonstrated in Visual Basic 6.0).


    Code Snippet

    Private Sub cmdSearchForApplications_Click()


    Dim dbSoftwareUpdate As Database

    Dim recSupportedSoftware As Recordset


    Dim strVersionFilePath As String

    Dim strFileLine As String


    Dim blnSoftwareUpToDate


    Set dbSoftwareUpdate = OpenDatabase("C:\Software Update\Database.mdb")

    Set recSupportedSoftware = dbSoftwareUpdate.OpenRecordset("SupportedSoftware", dbOpenDynaset)


    Call recSupportedSoftware.MoveFirst


    Do Until recSupportedSoftware.EOF = True

    strVersionFilePath = recSupportedSoftware.Fields("VersionFilePath").Value


    Open strVersionFilePath For Input As 1

    Do Until EOF(1)

    Line Input #1, strFileLine

    If InStr(1, strFileLine, recSupportedSoftware.Fields("LatestVersionNumber").Value) Then

    blnSoftwareUpToDate  = True


    blnSoftwareUpToDate = False

    End If


    Close #1


    '\\ Export to 'Download Latest Updates' procedure/function


    Call recSupportedSoftware.MoveNext



    End Sub




    Sunday, November 9, 2008 3:21 AM
  • 1. There are two ways you can find the list of installed programs.

    • %program files% is the default location applications are installed, but 90% of the applications does allow you to install applications anywhere in the hard drive...
    • On the other hand Registry key "HKEY_LOCAL_MACHINE\SOFTWARE" can give you list of applications installed on your machine.

    2. I would use last modified/created date of the .exe file to provide if the existing version is older than what you have in your database.


    Hope this helps your quest.


    { Gaja; }


    Wednesday, November 12, 2008 4:09 AM