InstallShield LE and Installation Requirements

dsk96m

Well-known member
Joined
Jan 11, 2013
Messages
173
Programming Experience
1-3
I require that Adobe reader be on the target machine when installing, but I DO NOT care if it is version 9 or 10. How do I set it up to say install if any version >= 9 is installed?
 
You can check for the appropriate registry key:

    Private Function IsAdobe9Installed() As Boolean
        IsAdobe9Installed = False

        Dim AdobeKey As RegistryKey = Registry.CurrentUser.OpenSubKey("Software").OpenSubKey("Adobe")

        If Not AdobeKey Is Nothing Then
            Dim ReaderKey As RegistryKey = AdobeKey.OpenSubKey("Acrobat Reader")

            If Not ReaderKey Is Nothing Then
                Dim AcrobatReaderVersions As String() = ReaderKey.GetSubKeyNames()

                Dim LatestVersion = (From VersionKey In AcrobatReaderVersions
                                     Order By VersionKey Descending
                                     Select VersionKey).FirstOrDefault

                If CDbl(LatestVersion) >= 9 Then IsAdobe9Installed = True
            End If
        End If

    End Function
 
I might add that in reality you might want this check to be a bit more thorough. The fact that the key itself exists does not mean that the application is still installed, but you can use the same technique to find the executable location and check if the file exists as well.
 
Back
Top