toolforger
toolforger

Reputation: 842

How to I call the "Read value from XML file" action from custom code?

The title says it all - I need to refactor multiple mini-actions into a single coherent piece of custom code, and to keep the refactoring under control, I want to stick with Install4J Actions as far as possible. I checked the type hierarchy below com.install4j.api.actions.Action but found nothing XML-related.

BTW eventually the installer will have to call the "Replace text in XML files" action as well.
I.e. I'll appreciate any hints for a general strategy to find any action, given the name shown in the "Select an installation Action" dialog or in the "Screens & Actions" section of the Install4J GUI.

Upvotes: 1

Views: 103

Answers (1)

Ingo Kegel
Ingo Kegel

Reputation: 48105

The class name of the action can be seen in the .install4j project file. For example, for the "Read value from XML file", the class name is

com.install4j.runtime.beans.actions.xml.XPathReadAction

You can instantiate it in custom code and execute it via

action.install(context);

Upvotes: 1

Related Questions