.MSI详细跟踪-运行CustomAction很有道理 [英] Making sense out on .MSI verbose trace - running a CustomAction

查看:187
本文介绍了.MSI详细跟踪-运行CustomAction很有道理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从.MSI详细跟踪中了解信息.我使用VisualStudio 2008创建了.MSI.

Making sense out of an .MSI verbose trace. I created the .MSI using VisualStudio 2008.

以下是我要执行的操作的背景: http://xmlpreprocess.codeplex.com/Thread/View.aspx?ThreadId= 79454

Here's the background on what I'm trying to do: http://xmlpreprocess.codeplex.com/Thread/View.aspx?ThreadId=79454

目标是运行一个类似于XmlPreprocess.exe的程序: xmlpreprocess.exe/x:SettingsFileGenerator.xml"/i:web.config"/e:QA/v

The goal is to run a program called XmlPreprocess.exe similar to this: xmlpreprocess.exe /x:"SettingsFileGenerator.xml" /i:"web.config" /e:QA /v

/x:parm来自我的一种用户界面形式,/e:值来自四个单选按钮的选择.

The /x: parm comes from one of my user interface forms, and the /e: value comes from a choice of four radio buttons.

我将属性"InstallerClass"设置为False, 和"CustomActionData"属性可以: /x:"[SETTINGSFILE]"/i:"[TARGETDIR] web.config" [CUSTOMSETTINGS]/e:[环境按钮] 我将属性参数"留空.

I set property "InstallerClass" to False, and property "CustomActionData" to: /x:"[SETTINGSFILE]" /i:"[TARGETDIR]web.config" [CUSTOMSETTINGS] /e:[ENVIRONMENTBUTTON] and I'm leaving property "Arguments" empty.

这是踪迹告诉我的.看来我的参数将转到适当的位置(我从单选按钮"中选择了质量检查").该错误与我在GUI屏幕上看到的错误相同,即"作为安装程序一部分运行的程序未按预期完成.请与您的支持人员或软件包供应商联系."不知道ErrorIcon信息仅仅是噪音还是相关信息.

Here's what the trace is telling me. It looks like my parms are going to the appropriate places (I selected "QA" from the Radio Button). The error is the same that I'm seeing on the GUI screen - that "A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor." I'm not sure if the ErrorIcon information is just noise, or if it is relevant.

MSI (s) (A4:58) [10:46:09:130]: Executing op: CustomActionSchedule(Action=_78D3A615_0FDF_491D_8BD0_4AA0A0DAE3C2,ActionType=3090,Source=C:\inetpub\wwwroot\TFBIC.RCT.WCFWebServicesSetup\XmlPreprocess.exe,,CustomActionData=/x:"c:\Source\TFBIC.RCT.BizTalk\TFBIC.RCT.BizTalk.Deployment\EnvironmentSettings\SettingsFileGenerator.xml" /i:"C:\inetpub\wwwroot\TFBIC.RCT.WCFWebServicesSetup\web.config"  /e:QA)
MSI (s) (A4:58) [10:46:09:728]: Note: 1: 1722 2: _78D3A615_0FDF_491D_8BD0_4AA0A0DAE3C2 3: C:\inetpub\wwwroot\TFBIC.RCT.WCFWebServicesSetup\XmlPreprocess.exe 4:  
MSI (s) (A4:58) [10:46:09:728]: Note: 1: 2262 2: Error 3: -2147287038 
MSI (c) (E0:C8) [10:46:09:763]: Note: 1: 2262 2: Error 3: -2147287038 
DEBUG: Error 2835:  The control ErrorIcon was not found on dialog ErrorDialog
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2835. The arguments are: ErrorIcon, ErrorDialog, 
**Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.**  Action _78D3A615_0FDF_491D_8BD0_4AA0A0DAE3C2, location: C:\inetpub\wwwroot\TFBIC.RCT.WCFWebServicesSetup\XmlPreprocess.exe, command:  
MSI (s) (A4:58) [10:46:11:630]: Note: 1: 2262 2: Error 3: -2147287038 
MSI (s) (A4:58) [10:46:11:630]: Product: TFBIC.RCT.WCFWebServices -- Error 1722. There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.  Action _78D3A615_0FDF_491D_8BD0_4AA0A0DAE3C2, location: C:\inetpub\wwwroot\TFBIC.RCT.WCFWebServicesSetup\XmlPreprocess.exe, command:  

Action ended 10:46:11: InstallExecute. Return value 3.
MSI (s) (A4:58) [10:46:11:633]: User policy value 'DisableRollback' is 0
MSI (s) (A4:58) [10:46:11:633]: Machine policy value 'DisableRollback' is 0

注意:通过执行以下操作,得到了上面的痕迹:

NOTE: got the above trace by doing this:

msiexec/i"TFBIC.RCT.WCFWebServicesSetup.msi"/L * V"C:\ logs \ WebServiceInstall.log"

msiexec /i "TFBIC.RCT.WCFWebServicesSetup.msi" /L*V "C:\logs\WebServiceInstall.log"

更新:基于以下注释-XmlPreprocess.exe(我的CustomAction)返回的非零返回码.那么我该如何调试呢?我需要查看通常在命令窗口中显示的结果.

Update: Based on comments below - the XmlPreprocess.exe (my CustomAction) is returning a non-zero return code. So how can I debug that? I need to see the results that would normally be in the command window.

更新01/07: 似乎无法在没有看到程序输出的情况下进行调试,这就是我真正需要的.当安装程序出现错误时,我可以在该目录中看到文件,直到单击确定"按钮并将其全部删除为止.我转到命令提示符,键入xmlpreprocess.exe,然后从"/x:"c:\Source\TFBIC.RCT.BizTalk\TFBIC.RCT.BizTalk.Deployment\EnvironmentSettings\SettingsFileGenerator上方的日志中复制/粘贴完全相同的字符串. .xml"/i:"C:\inetpub\wwwroot\TFBIC.RCT.WCFWebServicesSetup\web.config"/e:QA,它运行正常.

Update 01/07: Seems like this is impossible to debug without seeing the output of the program - that's what I really need. When the installer gives an error, I can see the files in that dir until I click the OK button and it deletes them all. I go to command prompt, type in xmlpreprocess.exe then copy/paste the exact same string from the log above "/x:"c:\Source\TFBIC.RCT.BizTalk\TFBIC.RCT.BizTalk.Deployment\EnvironmentSettings\SettingsFileGenerator.xml" /i:"C:\inetpub\wwwroot\TFBIC.RCT.WCFWebServicesSetup\web.config" /e:QA" and it runs fine.

我知道Ryan关于丢失文件的观点,对此表示感谢.但是XmlPreprocess程序的输出中可能会清楚地显示许多潜在的错误.当然有某种方式可以看到输出吗?

I see Ryan's point about a missing file, thanks for that. But there could be dozens of potential errors that should be clearly displayed in the output of the XmlPreprocess program. Surely there is someway to see the output?

两个可能丢失的文件是: 1)web.config本身(在此) 2)用户键入的文件名.

The two potential missing files are: 1) the web.config itself (it's there) 2) the name of the file the user types in.

据我所知,没有办法验证用户是否输入了有效的文件名,并且安装对话框中没有文件选择器".正确的?或者没有?

As far as I can tell, there is no way to validate that the user typed in a valid filename, and there is no "file picker" available in the dialog boxes of the install. Correct? or no?

因此,即使用户确实输入了错误的文件名,我也需要给他一个更好的信息,而不是 作为安装程序一部分运行的程序未按预期完成.请与支持人员或程序包供应商联系."

So even if the user did type in bad filename, I need to give him a better message than "A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor."

也许我应该为XmlPreprocess编写自己的C#包装器并调用它,然后拦截输出并读取它???

Maybe I should write my own C# wrapper for XmlPreprocess and call it, then intercept the output and read it???

推荐答案

就像您的

Like in your previous question where I suggested using cmd.exe /C XmlPreProcess.exe ... for redirection, for debugging you can try with /K instead of /C. Then any output should stick around, and you'd be able to work within the context of the MSI at the time of error.

我真正怀疑的问题是您的自定义操作的时间安排.如果此操作是立即执行的,计划在InstallFinalize之前执行,并且旨在对将要安装的文件进行操作,则它将在将文件安装到所需位置之前运行.正确的解决方法通常是运行脚本内操作(也称为延迟操作),以便通过在InstallFiles和InstallFinalize之间进行调度,使其实际上在相应的位置运行.

What I really suspect is the problem is the scheduling of your custom action. If this action is immediate, scheduled before InstallFinalize, and intended to operate on a file you will be installing, it will run before files are installed to the location you expect. The proper fix for this is generally to run the action in-script (also called deferred) so that by scheduling it between InstallFiles and InstallFinalize, it actually runs in that corresponding location.

关于为最终用户提供更好的错误,或允许他们浏览文件,这些都将采取自定义操作,并且可能需要是DLL操作(EXE操作只能提供通过/失败反馈).提供浏览对话框还是验证用户提供的路径是更好(或更容易),这将由您选择.我不确定您可以在Visual Studio Installer项目中执行多少操作(这是我假设您正在使用的标记).

As for providing better errors for your end users, or allowing them to browse for a file, these would both take custom actions, and probably need to be DLL actions (EXE actions can provide only pass/fail feedback). It will be your choice whether it's better (or easier) to provide a browse dialog or to verify the path the user provides. I'm not certain how much of this you can do in a Visual Studio Installer project (which is what I'm assuming you're using by your tags).

这篇关于.MSI详细跟踪-运行CustomAction很有道理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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