Question

I have to implement a custom action to search the windows registry for the installed version of the dotnet framework. Therefore I thought to extend the ReadRegistryValueAction to integrate my individual search algorithm. But the custom action will not be found at the IDE. So I extends the action from the AbstractInstallAction and included the RegistryRoot class to configure the action inside the IDE the same way as with provided registry actions of install4j framework.

public class CheckDotNetInstallationAction extends AbstractInstallAction {

    private RegistryRoot registryRoot;  

    public RegistryRoot getRegistryRoot() {
        return registryRoot;
    }

    public void setRegistryRoot(RegistryRoot registryRoot) {
        this.registryRoot = registryRoot;
    }

    @Override
    public boolean install(InstallerContext paramInstallerContext)
            throws UserCanceledException {
        // do custom search
        return false;
    }
}

But instead to get a dropdown list, there is only a blank field. I expected also a dropdown list the same way as in the present registry action. Now there are two questions:

  1. Is it possible to extends existing actions/screens/forms and to use and configure it in the IDE or is it necessary to extends from the AbstractInstallAction?
  2. How can I use classes like RegistryRoot for my custom components the same way as they are used in the actions provided by the install4j framework? Specifically the way to configure these components inside the IDE.
Was it helpful?

Solution

You have to add add a BeanInfo class and set an enumeration mapper. See the source file

samples/customCode/SampleActionBeanInfo.java

in your install4j install4j Installation and and look for the the call to setEnumerationMappers.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top