Вопрос

So.. I've got this CA

<CustomAction Id="InstallSetProp" Property="CustomActionData" Value="<some other data that's formatted exactly the same> /webconftmploc=&quot;[WEBCONFIGTMPLOC]&quot;" />

However, when this CA is called, a message box is shown saying "Error Getting Property" which is bogus since the property is correctly set and accessible later on. (And does nothing except mess up my attempts to fully automate installation) I'm running the .msi through a bootstrapper that switches /qr to help with this.

The message box error is not shown when /webconftmploc=&quot;[WEBCONFIGTMPLOC]&quot; is removed, for the record [WEBCONFIGTMPLOC] is either an absolute file path or "Not Set" and I'm wondering if there's any special reason why this behaviour can occur.

However, I'm much more interested in any possible way to suppress or fix this action, of-course.

Это было полезно?

Решение

That CustomAction only sets a property. It is not possible for it to show an error message. If any of the properties were not defined they would just resolve to blank. Something else must be showing the error message.

However, it appears that you are trying to pass data to a deferred custom action due to your use of the specially named CustomActionData. That isn't quite the way to use CustomActionData though. Instead, the Property attribute should be set to the Id of the CustomAction that you want to pass data too. Say the custom action that uses that property value is something like:

<CustomAction Id='MyDeferredCustomAction' Execute='deferred' ... />

To pass it the string you are trying to send, you could write:

<CustomAction Id="InstallSetProp"
              Property="MyDeferredCustomAction"
              Value="<some other data that's formatted exactly the same> /webconftmploc=&quot;[WEBCONFIGTMPLOC]&quot;" />

Notice that the second custom action is setting a property with the same name as the deferred custom action: MyDeferredCustomAction. The MyDeferredCustomAction can access the value <some other data that's formatted exactly the same> /webconftmploc="value_of_WEBCONFIGIMPLOC_goes_here" via the magical CustomActionData property. You can read more about that here: http://msdn.microsoft.com/en-US/library/2w2fhwzz(v=VS.80).aspx

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top