Wenn es noch jemanden interessieren sollte: Meine Lösung für dieses Problem besteht darin, die Befehle in einer minimierten Eingabeaufforderung laufen zu lassen (DosInAnIcon). Ich hatte noch das Problem, dass der Exit-Code von der DosInAnIcon-Implementierung nicht ausgewertet wird, ich ihn aber dringend benötige (ein Verlassen der Batch-Datei mit
am Ende hat nichts gebracht). Ich habe es so gelöst, dass ich im Batch-Abschnitt den aktuellen Exit-Code ausgebe und die Ausgabe in winst wieder auswerte. Nicht sehr elegant, aber es funktioniert.
Das folgende Script dient als Wrapper für ein VBS-Installationsscript, wobei die Produkt-Properties in Form von Umgebungsvariablen an das Script übergeben werden:
Code: Alles auswählen
[Initial]
Message=Installiere Adobe Photoshop Elements 9
LogLevel=2
ExitOnError=false
ScriptErrorMessages=on
TraceMode=off
StayOnTop=false
[Aktionen]
DefVar $Product$
DefVar $InstLogfile$
DefVar $DisplayName$
DefVar $LicenceKey$
DefVar $DisableFileAgent$
DefVar $ExitCode$
DefVar $ExitCodeLine$
DefStringList $Output$
Set $InstLogfile$ = "%SYSTEMDRIVE%\tmp\pselements9_install_log.txt"
Set $LicenceKey$ = GetProductProperty("licencekey", "")
Set $DisableFileAgent$ = GetProductProperty("disablefileagent", "true")
Set $Output$ = getOutStreamFromSection('DosInAnIcon_Install')
Set $ExitCodeLine$ = takeFirstStringContaining($Output$, "son:ExitCode=")
Set $ExitCode$ = TakeString(1, SplitString($ExitCodeLine$, "="))
if not ($ExitCode$ = "0")
LogError "Script failed with exit code " + $ExitCode$
isFatalError
endif
[DosInAnIcon_Install]
@echo off
set son:Serialnumber=$LicenceKey$
set son:DisableFileAgent=$DisableFileAgent$
cscript.exe /NoLogo "%SCRIPTPATH%\install.vbs"
echo son:ExitCode=%errorlevel%