You can also use these functions. GetRegAppBase can be modified to return whatever you need to determine which app is running.
Code:
Public Function GetAppPath() As String
'returns path of acad.exe for current desktop app
'you may need to append a backslash when concatenating text
Dim strPath As String
strPath = ThisDrawing.Application.Path
GetAppPath = strPath
End Function
Public Function GetAppRegBase() As String
Dim str As String
str = GetAppPath
Select Case str
Case Is = "C:\Program Files\Autodesk Map 3D 2005"
GetAppRegBase = "Software\Autodesk\AutoCAD\R16.1\ACAD-302:409\"
Case Is = "C:\Program Files\Autodesk Building Systems 2007"
GetAppRegBase = "Software\Autodesk\AutoCAD\R17.0\ACAD-5006:409\"
Case Else
GetAppRegBase = ""
End Select
End Function