在延迟的自定义操作之间传递数据 [英] Pass data between deferred custom action

查看:61
本文介绍了在延迟的自定义操作之间传递数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要将数据从一个延迟的.NET自定义操作传递到另一个,但我不知道该怎么做。

I need to pass data from one deferred .NET custom action to another, but I can't figure out how to do this.

延迟的自定义操作可以'无法访问Windows Installer会话,因此不能选择会话属性。目标延迟的自定义操作已经在使用从较早的即时自定义操作中设置的自定义操作数据,但是我似乎无法从源延迟的自定义操作中对其进行修改。

Deferred custom actions can't access the Windows Installer session, so session properties are not an option. The target deferred custom action is already taking custom action data that is set from an earlier immediate custom action, but I don't seem to be able to modify this from the source deferred action.

我也尝试过在自定义操作类上使用静态属性,但正如预期的那样,它也不起作用。

I've also tried using static properties on the custom action class, but as expected, that doesn't work either.

我可以写注册表在源代码操作中读取并在目标操作中将其读回,但这似乎有些棘手。

I could write to the registry in the source action and read it back in the target action, but that seems somewhat hacky. Surely there is a more standard way to pass data between deferred custom actions?

推荐答案

是的,很好的疑问。


肯定有更标准的方式在延迟的
自定义操作之间传递数据吗?

Surely there is a more standard way to pass data between deferred custom actions?

不,据我所知,没有这样的标准系统。

老实说,延迟动作可以通过 CustomActionData 读取属性已经是一个奇迹,这是在生成执行脚本时通过某种元数据完成的。延迟的操作只能访问一些有限的属性,并且它不能与MSI数据库进行交互

To be completely honest, it's already miracle that deferred actions can read properties through CustomActionData - that's done through some kind of metadata when generating the execution script. Deferred actions can access only few limited properties, and it can't interact with the MSI database.

请参见获取延后执行自定义操作的上下文信息以了解更多信息。

See Obtaining Context Information for Deferred Execution Custom Actions for more. It's not WiX limitation, but MSI.

正如您所说,查看临时文件夹或注册表-尽管不一定方便或不错-如果仔细完成,它将很好地工作

As you said, either look into temp folders or registry - although not necessarily convenient or nice - it will work very nicely if done carefully.

如果您有兴趣了解有关MSI架构的更多信息,这是一个很好的链接: http://bonemanblog.blogspot.co.uk/2005/10/custom-action-tutorial-part-i- custom.html

If you're interested understanding more about MSI architecure, this is very good link: http://bonemanblog.blogspot.co.uk/2005/10/custom-action-tutorial-part-i-custom.html

这篇关于在延迟的自定义操作之间传递数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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