#If VBA7 Then
Public
Declare
PtrSafe
Function
FindExecutable
Lib
"shell32.dll"
Alias
"FindExecutableA"
(
ByVal
lpFile
As
String
,
ByVal
lpDirectory
As
String
,
ByVal
strBuffer
As
String
)
As
Long
#Else
Public
Declare
Function
FindExecutable
Lib
"shell32.dll"
Alias
"FindExecutableA"
(
ByVal
lpFile
As
String
,
ByVal
lpDirectory
As
String
,
ByVal
strBuffer
As
String
)
As
Long
#End If
Public
Function
PfadInstallation(
ByVal
strDatei
As
String
)
As
String
strOrdner = Left(strDatei, InStrRev(strDatei, "\"))
strBuffer = Space(255)
lngRet = FindExecutable(strDatei, strOrdner, strBuffer)
If
lngRet > 32
Then
If
InStr(strBuffer, vbNullChar) > 1
Then
PfadInstallation = Left(strBuffer, InStr(strBuffer, vbNullChar) - 1)
End
If
Else
PfadInstallation = FEHLER
End
If
End
Function