When using a Microsoft.Deployment.WindowsInstaller.FeatureInfo
object via a custom action many of the properties throw an error stating "The handle is invalid." when accessed.
The following properties are one's that I have confirmed this behavior:
FeatureInfo.Attributes
FeatureInfo.CurrentState
FeatureInfo.Title
FeatureInfo.Description
I believe this may be happening due to the fact that these accessors are calling functions via the NativeMethods class instead of the RemotableNativeMethods class.
Example:
FeatureInfo fi = session.Features["MyFeatureName"];
InstallState iState = fi.CurrentState;
//The line above throws the error
Note: I have not had the chance to see if this issue is prevalent in any other classes used via a Session object. (Such as session.Components or session. Database.)
Logged In: YES
user_id=2086430
Originator: NO
The set of APIs remoted for managed CAs is based on the documentation at http://msdn.microsoft.com/en-us/library/aa368612.aspx ("Functions Not for Use in Custom Actions"). According to that page, MsiGetFeatureInfo must never be called from a custom action. Obviously the properties on the FeatureInfo class are just a wrapper around that API.
Do you know if it is possible to call MsiGetFeatureInfo from an unmanaged CA? If so then maybe the documenteation is wrong.
Logged In: YES
user_id=2122123
Originator: YES
I have actually never tried that call from an unmanaged CA so I am not sure if it works, but I'm guessing the documentation is probably correct so I apologize. However, the actual property I need to access from my CA is CurrentState which calls MsiGetFeatureState. This property calls NativeMethods.MsiGetFeatureState and fails. RequestState, on the other hand calls RemotableNativeMethods.MsiGetFeatureState and succeeds. So, it looks like Attributes, Title, and Description function correctly since the call to MsiGetFeatureInfo shouldn't be made from a CA but CurrentState is still an issue.
This Tracker item was closed automatically by the system. It was
previously set to a Pending status, and the original submitter
did not respond within 15 days (the time period specified by
the administrator of this Tracker).