Das Notes Forum

Domino 9 und frühere Versionen => Entwicklung => Thema gestartet von: animate am 05.12.03 - 10:04:07

Titel: Wo liegt die Notes.exe?
Beitrag von: animate am 05.12.03 - 10:04:07
Kann ich das eindeutig herausfinden (auf Windows Clients)?
Bei mir stehts in der Registry. Ist das immer so?

Danke für Infos.
Titel: Re:Wo liegt die Notes.exe?
Beitrag von: Semeaphoros am 05.12.03 - 10:10:21
Nein, auf die Reh-Schizophrenie kannst Du Dich leider nicht verlassen, Notes läuft auch ohne die, und wenns mehrere Versionen auf demselben Client sind, ist nur eine zuverlässig eingetragen. Bei Löschen ohne Deinstallation bleiben die Einträge ebenfalls stehen. Nimm den Eintrag als Hinweis und ansonsten muss man eben die üblichen Suchstrategien anwenden, um eine Datei zu finden.
Titel: Re:Wo liegt die Notes.exe?
Beitrag von: animate am 05.12.03 - 10:16:32
Schade. Danke.
Titel: Re:Wo liegt die Notes.exe?
Beitrag von: eknori am 05.12.03 - 10:18:32

Code:  ========================================================================
Following code should be put in "Declaration" section of the object which uses this function.

Declare Function OSGetExecutableDirectory Lib "NNOTES.DLL" Alias "OSGetExecutableDirectory" (_
Byval DirName As String,_
Byval Size As Long) As Long
=========================================================================

Function GetNotesProgramDirectory As String
Dim DirPath As String*512
Dim Size As Long
Dim Handle As Long

GetNotesProgramDirectory=""

Handle=OSGetExecutableDirectory(DirPath,Size)

GetNotesProgramDirectory=DirPath
End Function
Titel: Re:Wo liegt die Notes.exe?
Beitrag von: Semeaphoros am 05.12.03 - 10:24:40
Genau das hab ich mich gefragt, ob die WinAPI endlich, endlich einen Call hat, mit dem man das machen kann, die Logik ist ja doch eigentlich seit Dos 1.0 bereits im Kernel vorhanden, aber M$ hat sich nicht dazu durchgerungen, das Ding mal zugänglich zu machen. Im Assembler war das seinerzeit eine recht mühsame Sache, insbesondere da der API-Exec-Aufruf die Suche nach dem Executable eben nicht durchführte .....

Danke Ulrich
Titel: Re:Wo liegt die Notes.exe?
Beitrag von: eknori am 05.12.03 - 10:32:02
@Jens: Es wird die Notes API verwendet !
Titel: Re:Wo liegt die Notes.exe?
Beitrag von: Semeaphoros am 05.12.03 - 10:34:23
Ups, da war ich etwas zu oberflächlich --- schade!

Und danke für den Hinweis, also hat M$ immer noch nix gelernt, das muss denen doch schon x-tausendmal unter die Nase gerieben worden sein. Nochmals danke.
Titel: Re:Wo liegt die Notes.exe?
Beitrag von: eknori am 05.12.03 - 10:41:16
Kannst ja mal dies hier probieren



Declare Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" (Byval lpFile As String, Byval lpDirectory As String, Byval sResult As String) As Long

   Private Function FindExecutableByExtension( FullPath As String ) As Variant
      Dim success&, pos&, sResult$, RetVal$, lpFile$, lpDirectory$, msg$
      
      sResult = Space$ ( MAX_PATH )
      lpFile$ = ExtractFileName ( FullPath )
      lpDirectory$ = Left$ ( FullPath , Len( FullPath ) - Len( lpFile$ ) )
      success = FindExecutable ( lpFile$ , lpDirectory$ , sResult )
      
      Select Case success
      Case ERROR_FILE_NO_ASSOCIATION: msg = "no association"
      Case ERROR_FILE_NOT_FOUND: msg = "file not found"
      Case ERROR_PATH_NOT_FOUND: msg = "path not found"
      Case ERROR_BAD_FORMAT: msg = "bad format"
      Case Is >= ERROR_FILE_SUCCESS:
         pos = Instr ( sResult , Chr$ ( 0 ) )
         If pos Then RetVal = Left$ ( sResult , pos - 1 )
      End Select
      FindExecutableByExtension = RetVal
   End Function


   Private Function ExtractFileName( FilePath As String ) As String
'// Extract the FileName from FullPath
'// Called by : Function FindExecutableByExtension
'// Calls : Function InstrBack
      ExtractFileName = Rightbp$( FilePath , InstrBack ( FilePath , "\" ) )
   End Function
Titel: Re:Wo liegt die Notes.exe?
Beitrag von: Semeaphoros am 05.12.03 - 11:46:17
Aha, stammt aus der DDE-Ecke, danke für den Hinweis.
Titel: Re:Wo liegt die Notes.exe?
Beitrag von: animate am 05.12.03 - 13:10:28

Code:  ========================================================================
Following code should be put in "Declaration" section of the object which uses this function.

Declare Function OSGetExecutableDirectory Lib "NNOTES.DLL" Alias "OSGetExecutableDirectory" (_
Byval DirName As String,_
Byval Size As Long) As Long
=========================================================================

Function GetNotesProgramDirectory As String
Dim DirPath As String*512
Dim Size As Long
Dim Handle As Long

GetNotesProgramDirectory=""

Handle=OSGetExecutableDirectory(DirPath,Size)

GetNotesProgramDirectory=DirPath
End Function

wow! muchas gracias
Titel: Re:Wo liegt die Notes.exe?
Beitrag von: animate am 05.12.03 - 13:25:21
ich habe mir erlaubt, an der Funktion etwas zu ändern, damit der zurückgelieferte String genauso lang ist, wie der Pfad selbst (also ohne NullChars)
Function GetNotesProgramDirectory As String
   Dim sDirPath As String*512
   Dim lSize As Long
   Dim lHandle As Long
   Dim nPosition As Integer
   
   GetNotesProgramDirectory = ""
   
   lHandle=OSGetExecutableDirectory(sDirPath,lSize)
   
   
   nPosition = Instr(1, sDirPath, Chr(0))
   If nPosition > 0 Then
      GetNotesProgramDirectory = Left(sDirPath, nPosition - 1)
   Else
      GetNotesProgramDirectory = sDirPath
   End If
End Function