WIX CustomAction - 如何在安装/日志中获取更多信息 [英] WIX CustomAction - how to get more info in install/log

查看:30
本文介绍了WIX CustomAction - 如何在安装/日志中获取更多信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人告诉我 WIX 中的 CustomAction 有一种方法可以在控制台日志中显示输出.我包含一个名为 XmlPreprocess.exe 的 .exe 来操作我的 web.config,基于名为 SettingsFileGenerator.xml 的文件中的参数,

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,

我是这样跑的:msiexec/i bin\Debug\TFBIC.RCT.WCFWebServicesWIXSetup.msi/L*V "C:\logs\WixInstall01.log"

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

这是我的 WIX 构建文件:

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>

安装日志显示:

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.

这是我第一次尝试做 WIX,所以请容忍我的无知.

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

谢谢

更新:

这是来自另一个论坛的引述 - 但他没有具体说明它是如何工作的,而且他似乎也不经常回来查看.

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 有一个自定义操作,可以捕获控制台输出并粘贴它直接进入详细的MSI日志,所以这就是我使用的.

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.

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

这会是他所说的工具吗?http://wix.sourceforge.net/manual-wix2/qtexec.htm尝试时出现此错误:错误 LGHT0103:系统找不到文件wixca.dll".我已经在整个磁盘上搜索了这个 .dll,但没有找到.

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.

推荐答案

要在安装 msi 时启用所有可能的日志记录,请使用 /lvx* logfile.txt 选项.但是,即使这样也不会记录作为自定义操作调用的命令行应用程序的 STDOUT 和 STDERR 输出.

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.

如果您自己编写了自定义操作,则可以向其中添加此类日志记录.例如,wix 附带的 DTF 库有一个方便的 Session.Log 方法,您可以调用它.有关详细信息,请参阅 c:\program files\windows installer xml v3\doc\dtf.chm,主题编写托管自定义操作".

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.

如果您还没有编写应用程序,您可以编写一个自定义操作来包装它.这样的包装器可以使用 .NET Process 类调用一个可执行文件,阅读 StandardErrorStandardOutput 流,并使用 Session.Log 上面提到的方法.

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.

编辑:我不知道任何标准自定义wix 中的操作将控制台输出发送到日志.试试 wix-users 邮件列表.

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.

这篇关于WIX CustomAction - 如何在安装/日志中获取更多信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆