Hallo,
nach der Installation eines Paketes wird auf Errorlevel geprüft, das funktioniert auch. Genauso wenn ich auf den Inhalt der Log Datei prüfe. Wenn ich ich die beiden If abfragen mit ODER vernüpfe funktioniert es nicht mehr.
Meine IF Abfrage:
IF DoesTextInFileExist ("KLRIWRP: Reboot needed!", "%temp%\$klriwrp.txt") == "0" | %ErrorLevel% <> "0" Then "SET:InstallationError" EndIf
Wo liegt der Fehler? Danke für Hinweise.
If Abfrage mit oder Verknüpfung
If Abfrage mit oder Verknüpfung
Gruß
Ralf Reich
--------------------------------
Empirum V24.0.3, Windows Server 2022, SQL 15.0 Standard
Ralf Reich
--------------------------------
Empirum V24.0.3, Windows Server 2022, SQL 15.0 Standard
Hallo auch,
Ich bin mir nicht sicher ob da vielleicht eine Klammer helfen würde:
IF (DoesTextInFileExist ("KLRIWRP: Reboot needed!", "%temp%\$klriwrp.txt") == "0" | %ErrorLevel% <> "0") Then "SET:InstallationError" EndIf
Falls nicht, würde ich einfach zwei Abfragen daraus machen:
IF DoesTextInFileExist ("KLRIWRP: Reboot needed!", "%temp%\$klriwrp.txt") == "0" Then "SET:InstallationError" EndIf
IF %ErrorLevel% <> "0" Then "SET:InstallationError" EndIf
Gruß
Amir
Ich bin mir nicht sicher ob da vielleicht eine Klammer helfen würde:
IF (DoesTextInFileExist ("KLRIWRP: Reboot needed!", "%temp%\$klriwrp.txt") == "0" | %ErrorLevel% <> "0") Then "SET:InstallationError" EndIf
Falls nicht, würde ich einfach zwei Abfragen daraus machen:
IF DoesTextInFileExist ("KLRIWRP: Reboot needed!", "%temp%\$klriwrp.txt") == "0" Then "SET:InstallationError" EndIf
IF %ErrorLevel% <> "0" Then "SET:InstallationError" EndIf
Gruß
Amir
Die Syntax der IF-Abfrage scheint in Ordnung, Herr Reich.
Ich empfehle das Konstrukt nochmal mit einfachen Vorgaben zu testen:
[Set:Product]
Set Var01=1
Set Var02=0
IF %Var01% == "1" | %Var02% == "1" THEN "Set:Bedingung_erfuellt" ENDIF
[Set:Bedingung_erfuellt]
Echo Bedingung erfüllt. Mindestens eine der Abfragen wurde positiv geprüft.
Danach kann man beide Werte tauschen und prüfen, ob das Ergebnis immer noch WAHR ist (nun für die 2. Abfrage), usw.
Ich empfehle das Konstrukt nochmal mit einfachen Vorgaben zu testen:
[Set:Product]
Set Var01=1
Set Var02=0
IF %Var01% == "1" | %Var02% == "1" THEN "Set:Bedingung_erfuellt" ENDIF
[Set:Bedingung_erfuellt]
Echo Bedingung erfüllt. Mindestens eine der Abfragen wurde positiv geprüft.
Danach kann man beide Werte tauschen und prüfen, ob das Ergebnis immer noch WAHR ist (nun für die 2. Abfrage), usw.
Visit my Blog: "DiEW - Das inoffizielle Empirum Weblog" (http://www.diew.eu)
Martin Niemann
Manager Support (Service Management)
Disclaimer: I participate in this forum on a voluntary basis. Views expressed are not necessarily those of matrix42 AG or of the support team.
Martin Niemann
Manager Support (Service Management)
Disclaimer: I participate in this forum on a voluntary basis. Views expressed are not necessarily those of matrix42 AG or of the support team.
Who is online
Users browsing this forum: No registered users and 0 guests
