WIX CustomAction - how to get more info in install

2019-04-08 11:36发布

Someone told me there was a way for the CustomAction in WIX to display the output in the console log. I'm including an .exe called XmlPreprocess.exe to manipulate my web.config, based on parms in a file called SettingsFileGenerator.xml,

I'm running like this: msiexec /i bin\Debug\TFBIC.RCT.WCFWebServicesWIXSetup.msi /L*V "C:\logs\WixInstall01.log"

This is my WIX build file:

 <CustomAction Id="**SAMPLE_CONFIG**" BinaryKey="XMLPREPROCESS" ExeCommand="/i:&quot;[INSTALLLOCATION]web.config&quot; /x:&quot;[INSTALLLOCATION]SettingsFileGenerator.xml&quot; /e:QA /d:ServiceLocation=[SERVICELOCATION]" Execute="deferred" />
    <Binary Id="XMLPREPROCESS" SourceFile="../TFBIC.RCT.WCFWebServices/RequiredBins/XMLPreprocess.exe" />
    <InstallExecuteSequence>
        <Custom Action="SAMPLE_CONFIG" After="StartServices"><![CDATA[NOT Installed]]></Custom>
    </InstallExecuteSequence>

Install log shows this:

Action 15:22:27: StartServices. Starting services
Action start 15:22:27: StartServices.
MSI (s) (58:CC) [15:22:27:898]: Note: 1: 2205 2:  3: ServiceControl
MSI (s) (58:CC) [15:22:27:898]: Note: 1: 2228 2:  3: ServiceControl 4: SELECT `Name`,`Wait`,`Arguments`,`Event`, `Action` FROM `ServiceControl`, `Component` WHERE `Component_` = `Component` AND (`Action` = 0 OR `Action` = 1 OR `Action` = 2)
Action ended 15:22:27: StartServices. Return value 1.
MSI (s) (58:CC) [15:22:27:899]: Doing action: SAMPLE_CONFIG
Action 15:22:27: SAMPLE_CONFIG.
Action start 15:22:27: **SAMPLE_CONFIG**.
SAMPLE_CONFIG:
Action ended 15:22:27: **SAMPLE_CONFIG**. Return value 1.

This is my very first attempt to do WIX, so please bear with my ignorance.

Thanks

UPDATE:

This is a quote from another forum - but he doesn't specify how it works and he doesn't seem to check back often.

WiX has a custom action that captures the console output and sticks it directly into the verbose MSI log, so that's what I use.

reference: http://xmlpreprocess.codeplex.com/Thread/View.aspx?ThreadId=79454

Would this be the tool he is talking about? http://wix.sourceforge.net/manual-wix2/qtexec.htm I get this error when trying it: error LGHT0103: The system cannot find the file 'wixca.dll'. I have searched entire disk for this .dll and could not find it.

1条回答
倾城 Initia
2楼-- · 2019-04-08 11:47

To enable all possible logging while installing an msi, use the /lvx* logfile.txt option. However, even this will not log the STDOUT and STDERR output of command line applications invoked as a custom action.

If you have written the custom action yourself, you can add such logging to it. For example, the DTF libraries that come with wix have a handy Session.Log method that you can call. See c:\program files\windows installer xml v3\doc\dtf.chm, topic "Writing Managed Custom Actions" for more information.

If you have not written the application, you could write a custom action to wrap it. Such a wrapper could use the .NET Process class to invoke an executable, read the StandardError and StandardOutput streams, and log everything with the Session.Log method mentioned above.

edit: I don't know of any standard custom action in wix that sends console output to the log. Try the wix-users mailing list.

查看更多
登录 后发表回答