简体   繁体   English

如何在MSI / Setup项目中调试自定义操作的失败

[英]How to debug failure of a custom action in an MSI/Setup project

For a custom action, I'm setting to Name to XmlPreprocess.exe (a CodePlex utility) 对于自定义操作,我将Name设置为XmlPreprocess.exe(CodePlex实用程序)

and arguments to: /x:"[SETTINGSFILE]" /i:"[TARGETDIR]web.config" /e:[ENVIRONMENTBUTTON] [CUSTOMSETTINGS] >[TARGETDIR]XmlPreProcess.log 和以下参数:/ x:“ [SETTINGSFILE]” /i:"[TARGETDIR]web.config“ / e:[ENVIRONMENTBUTTON] [CUSTOMSETTINGS]> [TARGETDIR] XmlPreProcess.log

SETTINGSFILE is supposed to be coming from a custom form page I added, and ENVIRONMENTBUTTON is the value of one of my radio buttons. SETTINGSFILE应该来自我添加的自定义表单页面,而ENVIRONMENTBUTTON是我的单选按钮之一的值。

Is there any way to get the redirect to work? 有什么办法可以使重定向工作? It's not creating the .log file. 它不是在创建.log文件。 Is there any other way to see the results of the custom action? 还有其他方法可以查看自定义操作的结果吗? How can I even confirm if it ran? 我什至不能确认它是否已运行? What if I would like to see what parms were sent to it? 如果我想查看发送给它的参数怎么办?

Update 3: - For more scenarios of what I have tried, see here: http://xmlpreprocess.codeplex.com/Thread/View.aspx?ThreadId=79454 更新3:-有关我尝试过的更多情况,请参见此处: http : //xmlpreprocess.codeplex.com/Thread/View.aspx?ThreadId=79454

Thanks, 谢谢,

Neal 尼尔

Update: I just wrote a quickie VBScript to verify my parms. 更新:我刚刚编写了一个快速VBScript来验证我的参数。

dim fso, oFile 
set fso = Createobject("Scripting.FileSystemObject") 
set oFile = fso.CreateTextFile("VBScriptOut.txt") 

if WScript.Arguments.Count < 2 then 
   oFile.Writeline("Number of arguments was only = " & WScript.Arguments.Count)
else 
   oFile.WriteLine("SETTINGSFILE=" & WScript.Arguments.Item(0))   
   oFile.WriteLine("ENVIRONMENTBUTTON=" & WScript.Arguments.Item(1))
end if 

oFile.close

No VBScriptout.txt was created, so I don't think it even ran (so my guess is the XmlPreprocess isn't even running either). 没有创建VBScriptout.txt,所以我认为它甚至没有运行(所以我猜XmlPreprocess甚至都没有运行)。

I included the InstalLVerification.vbs file as a Custom Action under "Install". 我将InstalLVerification.vbs文件作为“安装”下的“自定义操作”包含在内。 I set the condition= True in the properties window. 我在属性窗口中设置condition = True。 I set CustomActionData to: "[SETTINGSFILE]" [ENVIRONMENTBUTTON] 我将CustomActionData设置为:“ [SETTINGSFILE]” [ENVIRONMENTBUTTON]

Update 2: I realized now Condition should not be "True". 更新2:我意识到现在条件不应该为“ True”。 I either blank it out or set it to "Not Installed". 我将其清空或将其设置为“未安装”。

I'm getting an unexplained error on XmlPreprocess, and I cannot get the VBScript to run. 我在XmlPreprocess上收到无法解释的错误,并且我无法运行VBScript。 I tried running it also with CScript64.exe. 我也尝试使用CScript64.exe运行它。

Only the command prompt (and occasional other tools) use the greater-than symbol to indicate output redirection. 仅命令提示符(和偶尔的其他工具)使用大于号表示输出重定向。 Windows Installer just calls the Win32 CreateProcess API which does not process this symbol. Windows Installer只是调用Win32 CreateProcess API,它不会处理该符号。 Thus your attempt to log the results will not work. 因此,您尝试记录结果将不起作用。 Perhaps you can rewrite your command to look like cmd.exe /c XmlPreprocess.exe /x ... > [TARGETDIR]XmlPreprocess.log (some extra quoting may be required). 也许您可以将命令改写为cmd.exe /c XmlPreprocess.exe /x ... > [TARGETDIR]XmlPreprocess.log (可能需要一些额外的引号)。

For debugging purposes, you can generally get a lot more information by taking a verbose log of the installation process. 为了进行调试,通常可以通过获取详细的安装过程日志来获取更多信息。 It will include a listing of properties, and of custom actions it launched and their return codes. 它将包括属性列表,启动的自定义操作及其返回代码。 I think it will even include the fully formatted command line passed to the application in your case. 我认为它甚至将包括传递给您的应用程序的全格式命令行。

Like you say in Update 2, note that a condition of True actually means to look up whether a property of the name True is defined. 就像您在Update 2中说的那样,请注意,条件为True实际上意味着查找是否定义了名称为True的属性。 If you want something that's always true, use the value 1 . 如果您想要始终为真的值,请使用值1

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 用于“安装和部署Visual Studio”的自定义安装项目-如何获取.msi文件所在的文件夹的内容? - Custom setup project for “Setup and Deployment Visual Studio”- How to get the contents of the folder where the .msi file resides? 将自定义操作添加到VS 2008安装项目 - Add Custom action to VS 2008 Setup project 如何在Windows安装程序项目中首先更改入口点或执行自定义操作? - How can I change the entry point or perform a custom action first in a Windows Setup project? 在Visual Studio安装项目中,如何防止有条件的自定义操作运行? - In a visual studio setup project, how do I prevent a conditional custom action to run? 如何从VS2008安装项目中的自定义操作脚本返回值 - How to return a value from custom action script in a VS2008 setup project 任何 MSI 安装项目上的“不可恢复的构建错误” - "Unrecoverable build error" on any MSI Setup project 在Visual Studio安装项目中从自定义操作设置应用程序文件夹 - Set Application Folder from Custom Action in Visual Studio Setup project 如何使用自定义操作实施安装和部署项目 - How to implement Setup and Deployment project with Custom Actions 安装项目msi builds +声称安装成功,但没有输出 - Setup Project msi builds+ claims successful install, but no output VSX:自定义软件包的项目类型为mimik“调试&gt;&gt;开始操作&gt;&gt;启动外部程序” - VSX: Custom Package's Project Type to mimik “Debug >> Start Action >> Start External Program”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM