|
Check whether there is a corresponding key value in the registry, give you an example of detecting whether excel is installed
Public Const HKEY_LOCAL_MACHINE As Long =&H80000002
Public Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Dim lRet As Long, hKey As Long
lRet = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Office\11.0\Excel", hKey)
If lRet <> 0 Then
'no excel instralled
Else
'excel installed
lRet = RegCloseKey(hKey)
End If
You can find the key value of Matlab after you have installed it and open the registry.
Another method is that you create a matlab object, if there is an error, it means that it is not installed on the machine |
|