DTF and MsiGetProperty

南楼画角 提交于 2019-12-11 06:46:19

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/4678451/dtf-and-msigetproperty

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!