Revenera Documentation site will be unavailable on July 2nd due to scheduled maintenance. For more information see the status dashboard.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
TurboFisch
Level 7

why does msigetporty fail?

I set a property via custom action property successfully, and the new value shows up in dialogs like InstallWelcome. However, msgetproperty fails to retrieve the value and even the "MessageBoxEx" shows the previous value of the property.
Labels (1)
0 Kudos
3 Replies
DLee65
Level 13

Hi Turbo,

I do not know the details of your project but if the property is used in a deferred custom action, then I know that calling MSIGetProperty("MYGREATPROPERTY") will not return the data. It is because deferred custom actions only have access to a handful of properties, as you might recall.

IF this is a deferred custom action, then try creating a property that sets the value to a property that is the same name as your custom action. For example, let's say that your custom action is named "MyDeferred_Function". Then you would set the name of the property to MyDeferred_Function and assign it the value you want for "MYGREATPROPERTY".

Then in your code, call MSIGetProperty("CustomActionData"), this will now contain the value of MyDeferred_Function.

Now let's say this is the case, AND you need to access multiple properties. The only solution is to string the values together with a delimiter separator. Then in your custom action split the data into its individual parts.

If your custom action is not a deferred custom action then I would just double check to make sure your property is all upper case characters because only public properties can be modified at runtime.

Also create a MSI log file to see if it validates that a property is being set correctly. My guess is yes since the UI can display the value correctly, which is why I was thinking that your action maybe deferred.
0 Kudos
TurboFisch
Level 7

That is what the problem was.

I wish there was a single API that we could just call with a single call, instead of 2. Ir seems to me that I have to do this for each property. It would be nice to just initialize all properties in a single call, and then use them later in deferred CA.

Thanks
0 Kudos
DLee65
Level 13

Hi Turbo,

Yes, I agree. If I was dealing with deferred custom actions all of the time then this would be less of an issue, but having different rules for different segments of an installer just makes a complex process more error prone as you discovered.

I know I have been bitten by this problem before and probably will again.

😄
0 Kudos