简体   繁体   中英

install4J 7.0.6 doesn‘t find my BeanInfo

I would like to add descriptions to our custom actions, but it seems that install4J doesn't find my BeanInfo. I tried the customCode-sample provided with install4J and it doesn´t work either. My code is distributed in a jar. I tried to add it to the extensions folder and reference it at the Custom Code. Bean:

package example;

import com.install4j.api.actions.AbstractInstallAction;
import com.install4j.api.context.InstallerContext;
import com.install4j.api.context.UserCanceledException;

public class MyAction extends AbstractInstallAction{

  private static final long serialVersionUID = 2655170043113696434L;

  @Override
  public boolean install(InstallerContext context) throws UserCanceledException {
    return false;
  }

}

BeanInfo:

package example;

import com.install4j.api.beaninfo.ActionBeanInfo;

public class MyActionBeanInfo extends ActionBeanInfo {

  protected MyActionBeanInfo() {
    super("My Action", "Execute my Code", "Other", false, true, 0, MyAction.class);
  }

}

Manifest:
Name: example/MyAction.class
Install-Action: true

What do i miss?

The constructor of your MyActionBeanInfo class is protected, the introspector will not be able to instantiate it. If you make it public, it should work.

I tried to add it to the extensions folder and reference it at the Custom Code

If the custom code is part of the project, you should add the JAR file with the compiled classes on the "Installer->Custom Code & Resources" step instead.

When adding an action, choose "Custom code->Search Action in Custom Code", your action should then be displayed with the proper name.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM