DTF 和 MsiGetProperty
相关于:从 DTF 访问 InstallShield“支持文件”(托管自定义操作)
我需要读取属性 SUPPORTDIR。根据此论坛(http://community.flexerasoftware.com/showthread .php?t=180742&page=3),我需要使用 MsiGetProperty。
如何从 DTF 调用 MsiGetProperty?
Related to: Accessing InstallShield "Support Files" from DTF (Managed Custom Action)
I need to read the property SUPPORTDIR. According to this forum (http://community.flexerasoftware.com/showthread.php?t=180742&page=3), I need to use MsiGetProperty.
How can I call MsiGetProperty from DTF?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
DTF 的 Session 类具有以下方法:
public string this[string property] get: set:
这会远程到非托管 C++ 端,在其中调用 MsiGetProperty 和 MsiSetProperty。它有点像 VBScript Session.Property("SUPPORTDIR"),只是更简单。
InstallShield 应该安排一个名为 ISSetupFilesExtract 的自定义操作。记录您的安装并查看它是否正在执行并将路径分配给该属性。
我能想到的唯一的其他问题是,如果您正在执行一个不提升 UI 但随后提升执行序列的正确 UAC 故事,请确保 SUPPORTDIR 列在 SecureCustomProperties 属性中。只有在 UI 序列中获取值的“安全”属性才会转移到执行序列。 “PUBLIC”属性将默认恢复为安装程序开始执行时的状态。
我可以告诉您,我在 DTF 自定义操作中使用 SUPPORTDIR(有时直接使用,有时通过 CustomActionData 序列化),并且没有任何问题。
DTF's Session class has the method:
public string this[string property] get: set:
This gets remoted over to the unmanaged C++ side where they invoke MsiGetProperty and MsiSetProperty. It's kind of like VBScript Session.Property("SUPPORTDIR") only simpler.
InstallShield should have scheduled a custom action called ISSetupFilesExtract. Log your install and see if it's executing and assigning the path to the property.
The only other gotcha I can think of is if you are doing a proper UAC story of non-elevating your UI but then elevating your Execute sequence, make sure that SUPPORTDIR is listed in the SecureCustomProperties property. Only "Secure" properties that get a value in the UI sequence are carried over to the execute sequence. "PUBLIC" properties will default back to whatever then were when the installer started executing.
I can tell you that I use SUPPORTDIR ( sometimes directly and sometimes via CustomActionData serialization) in my DTF custom actions and I have no problems with it.
要将我的评论中的信息复制并扩展为访问InstallShield“支持DTF(托管自定义操作)中的“文件”:
将 Session 类的对象传递给 DTF 中的自定义操作。使用 session["SUPPORTDIR"] 访问属性值(立即执行操作)。对于延迟操作,您必须通过 CustomActionData 传递它。另外,对于即时 CA,请确保您安排了在 CostFinalize 之后读取 SUPPORTDIR 的操作 - 此时目录表中的所有条目都可以作为属性进行访问。
To duplicate and extend the info from my comment to Accessing InstallShield "Support Files" from DTF (Managed Custom Action):
An object of Session class is passed to the custom action in DTF. Use session["SUPPORTDIR"] to access the property value (for immediate action). For deferred action, you'll have to pass it via CustomActionData. Also, for immediate CA, make sure you scheduled the action which reads SUPPORTDIR after CostFinalize - the point when all entries in Directory table become accessible as properties.