When does MSIGetProperty() API return nothing in its third parameter? - installshield

I am trying to query the CLIENTPROCESSID of the msiexec.exe process using the MSIGetProperty() API. The third parameter of this API should get the value of the property being passed as per Microsoft Docs. After calling,his API returns 0, which I think means ERROR_SUCCESS. However there is blank value or nothing within the szValueBuf parameter.
I have followed the exact method of getting the value as per https://learn.microsoft.com/en-us/windows/desktop/api/msiquery/nf-msiquery-msigetpropertya. I tried going through various Microsoft Docs but was not able to get satisfying answers.
return_value = MsiGetProperty(msihandle, _T("CLIENTPROCESSID"), msiPID, &size);
I would expect the process ID of msi process to be present within the msiPID but the string doesn't have any value at all.

Your question doesn't include quite enough to be certain about this, but I suspect your custom action is deferred, and thus CLIENTPROCESSID is unavailable. Unavailable properties are treated just like any other unset property, and thus are equivalent to an empty string, hence the successful return code with an empty output. Note that MsiGetProperty...
Supports a limited set of properties when used with deferred execution custom actions: the CustomActionData property, ProductCode property, and UserSID property.Commit custom actions cannot use the MsiGetProperty function to obtain the ProductCode property. Commit custom actions can use the CustomActionData property to obtain the product code.
Typically one must populate the CustomActionData property (by populating with an immediate action sequenced before the deferred action, a property with the same name as the deferred custom action) for any properties beyond those listed in the excerpt above.

Related

Stripe API - How to Retrieve a Plan or Price "currency_options" property?

There is ways to UPDATE or CREATE the Plan.currency_options or Price.currency_options property on the API request, but there is a way to retrieve the currency_options property?
When you look at the API Reference for the Price object, you can see all the properties that are associated with that object. You will see the currency_options property. Next to it it says Expandable which means it's not returned by default unless you ask for it.
You can read more about the Expand feature in the doc, specifically about how to include properties not returned by default here.
To summarize, you call the Retrieve Price API and pass expand: ['currency_options'] to get those back.

Is there a way to prevent callback until the input `id` is loaded?

I am new to Dash Plotly.
Is there a way to prevent a callback if an Id (at the current moment) used as a INPUT to one of the callbacks.
A nonexistent object was used in an `Input` of a Dash callback. The id of this object is `some-dropdown` and the property is `value`.
Or Is there a way to register all the component id in dash and later it can be used for rendering ?
You could use pattern matching callbacks. That's the most flexible solution. If you have a known number of IDs you'll add, then you could also include all of them in the app on initialization, and use callback logic to update them only after the specific trigger occurs. They could be hidden initially as well, then shown later by updating the style prop.

CQ5 QueryBuilder if Property has a value or has no value

I am running a query like to do determine if the page has the given tag(s)
predicates.put("property","jcr:content/cq:tags");
predicates.put("property.and","true");
predicates.put("property.1_value","properties:style");
predicates.put("property.2_value","properties:style/color");
I also want to be able to get all results that have any tag or query on all results that have no tag.
What would I put in the value section to check for these constraints
You need to set the operation parameter of the property predicate. Its semantic is described here: JcrPropertyPredicateEvaluator

Purpose of AssertRequiredRoles?

I am implementing my own RequiredRole attribute called RequiredAnyRole, whereby I pass in a list but the user only has to be in 1 of the roles. I have implemented my own method called HasAnyRole which simply queries based on .Any() instead of .All().
I have then overridden the Execute method to use my method rather than HasAllRoles. The problem is im not sure what the method: AssertRequiredRoles is doing? It doesn't seem to be called?
Should I override that to use .Any() rather then .All() too? Here is the original code:
https://github.com/ServiceStack/ServiceStack/blob/82241fc96e187d12f9db2556aea37cf327813adc/src/ServiceStack.ServiceInterface/RequiredRoleAttribute.cs
AssertRequiredRoles is a static helper method that's can be used by other plugins like RequestLogsService to ensure access is only granted to users with the required roles. It's not called when used as a normal attribute filter.
Once you override Execute you retain full control of what gets executed, so you only need to override what you need.

JSF: How do I include parameters in an action method's return string?

I'm writing an action method that will store a new object in a database. Once this is done, I want to navigate to view that newly created object. To do this, I was planning to include a querystring or some sort of parameter in the return String of the action method, but I can't figure out how. If I append a query string manually, it appears that it's being ignored. Also, manually adding parameters by concatenating strings doesn't seem like a good idea to me. Is it possible to do this in a type-safe manner?
The way I've always handled this is to get a reference to the bean which provides the content for the page you'll be displaying, and just set its properties directly. The navigation string returned from an action method isn't meant for passing parameters, but you don't need it to; all they'd be used for is setting bean properties anyway.

Resources