cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
manisha81
Level 5

MsiGetProperty reading CustomActionData return null.

Hi,


While Reading an array of Properties via "CustomActionData" Property through MsiGetProperty in unmanaged code returns 0 as Buffsize.

nStatus=MsiGetProperty (hInstall, TEXT("CustomActionData"), TEXT(""), &BuffSize);

BuffSize returns 0.

Is there smthing with managed and unmanaged code? I am using IS 2009.
Please help with some links which illustrates the way to get array of properties from "CustomActionData" using VC 6.0 unmanaged code.

Regards,
Labels (1)
0 Kudos
(6) Replies
MichaelU
Level 12 Flexeran
Level 12 Flexeran

Your code looks fine; did you set a property which matches the name of the deferred custom action running this code? If not, the CustomActionData property will not be set. Similarly if the custom action running this code is not deferred, it will not be set either.
0 Kudos

I Have Same Problem. but i didn't get any solution. Please Help me.

0 Kudos
manisha81
Level 5

Thanks Micheal. It worked
0 Kudos
manisha81
Level 5

Hi,

Can we set a property among the list of multiple properties of CustomActionData through MsiSetProperty() ina C++ Custom Action deferred in system context?

I know to get the values of the properties of array of CAD properties using MsiGetProperty() in CA which is deferred in system context.
using,

nStatus=MsiGetProperty (hInstall, TEXT("CustomActionData"), &Buff, &BuffSize);
After parsing Buff, one can easily get the values of Properties contained in CAD.

(CAD = {[Property A];[Property B];[Property C];[Property D];[Property E]})
Values of Property A, Property B, Property C etc can be easily obtained.

But,

Wht if i want to set a particular Property say [Property D] or both [Property D;Property E]

Isit possible in C++ custom action deferred in system context??

Please explain the way to acheive this.

Regards,
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

If I understand your question correctly, you're asking how you can set a property in a deferred custom action such that another custom action (probably also deferred) can read it. The short answer is you can't. Each deferred custom action runs in its own execution context, and you can only pass information into it via CustomActionData (and a few other select properties), and can only return an error code.

The long answer is the information you pass in can identify a shared location (think temporary file name) to read or write some information. Then this information can thus be shared among multiple actions. I'm uncertain whether this works fully in every scenario that Windows Installer supports, and there is some risk of privilege escalation, but it works in all the common ones.
0 Kudos
manisha81
Level 5

Hi Micheal,

Thanks for your reply.
Your understanding about my question is right. The set value of that Property is used by other deferred CA down in the sequence.

Allright, Probably i may need to write/read the values at some common location say temp file.

Is not there is any other way in case if this does not worked??

Regards,
- Manisha
0 Kudos