Wix CAQuietExec write to log on error

1

I have a custom action that executes a command line tool:

    <CustomAction Id="QtExecUpdateDatabase_Cmd" Property="QtExecUpdateDatabase" Value="&quot;[#DATABASEUPDATER.EXE]&quot;" Execute="immediate" />
<CustomAction Id="QtExecUpdateDatabase" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="check" />
<InstallExecuteSequence>
  <Custom Action="QtExecUpdateDatabase_Cmd" After="CostFinalize">NOT REMOVE</Custom>
  <Custom Action="QtExecUpdateDatabase" After="InstallFiles" >NOT REMOVE</Custom>
</InstallExecuteSequence>

In some cases it fails. The msi log looks like this:

SI (s) (98:98) [16:44:06:765]: Executing op: CacheSizeFlush(,)
MSI (s) (98:98) [16:44:06:765]: Executing op: InstallProtectedFiles(AllowUI=1)
MSI (s) (98:98) [16:44:06:765]: Executing op: ActionStart(Name=QtExecUpdateDatabase,,)
Action 16:44:06: QtExecUpdateDatabase. 
MSI (s) (98:98) [16:44:06:781]: Executing op: CustomActionSchedule(Action=QtExecUpdateDatabase,ActionType=1025,Source=BinaryData,Target=CAQuietExec,CustomActionData="D:\Documents and Settings\edugarcia\ConfiguraciĆ³n local\Datos de programa\Gamesa\HCAOffline\DatabaseUpdater.exe")
MSI (s) (98:B0) [16:44:06:796]: Invoking remote custom action. DLL: C:\WINDOWS\Installer\MSI2D.tmp, Entrypoint: CAQuietExec
MSI (s) (98:EC) [16:44:06:796]: Generating random cookie.
MSI (s) (98:EC) [16:44:06:812]: Created Custom Action Server with PID 3804 (0xEDC).
MSI (s) (98:90) [16:44:06:828]: Running as a service.
MSI (s) (98:90) [16:44:06:843]: Hello, I'm your 32bit Impersonated custom action server.
CAQuietExec:  Error 0x80131700: Command line returned an error.
CAQuietExec:  Error 0x80131700: CAQuietExec Failed
Action ended 16:44:07: InstallFinalize. Return value 3.

Is there any way to log an error message returned by the command line tool?

This command line tool have its own log, but, after fail, all the install process is rolled back, including my preciated log. How can tell wix to do not delete de log of my command line tool?

wix
windows-installer
wix-extension
asked on Stack Overflow Oct 8, 2013 by mnieto

2 Answers

0

Here is the solution:

Any text written by the app (both stdout and stderr) is written to the log, and any non-zero exit code is interpreted as a failure causing CAQuietExec to also return a failure.

answered on Stack Overflow Oct 8, 2013 by mnieto
0

I don't understand your assertion that WiX is rolling back the log. Windows Installer only rollsback what it created. If it called an EXE and the EXE wrote to a log, MSI wouldn't know about this and wouldn't roll it back.

FWIW, out of process EXE calls defeat the purpose of MSI. It's always best to figure out what it does and do it the best way possible.


User contributions licensed under CC BY-SA 3.0