Is there a way to get Wix 4 to log stderr (and stdout) from bat files executed during a Bundle installation?
Scenario:
I have a Wix Bundle that executes a bat file to create a database using SqlLocalDB:
<ExePackage
SourceFile="ConfigureDB.bat">
</ExePackage>
The content of the bat file is something like this:
cmd.exe --parameters1
cmd.exe --parameters2
cmd.exe --parameters3
Sometimes the bat script fails and the cmd.exe outputs relevant error information to stderr. To capture the error information I currently redirect output like this:
cmd.exe --parameters1 > C:\tmp\c1a.txt 2> C:\tmp\c1b.txt
cmd.exe --parameters2 > C:\tmp\c2a.txt 2> C:\tmp\c2b.txt
cmd.exe --parameters3 > C:\tmp\c3a.txt 2> C:\tmp\c3b.txt
That is not really useful once this MSI package is released, so the question is: how do I ensure the Wix installer captures the output of commands inside a bat script?