我想在我们的自定义操作中添加描述,但似乎install4J找不到我的BeanInfo。我尝试了install4J提供的自定义代码示例,它也不起作用。我的代码分布在一个jar中。我尝试将它添加到extensions文件夹中,并在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我错过了什么?
发布于 2018-08-29 19:05:52
您的MyActionBeanInfo类的构造函数是受保护的,内部检查器将无法实例化它。如果你把它公之于众,它应该会起作用。
我尝试将其添加到extensions文件夹,并在自定义代码中引用它
如果定制代码是项目的一部分,那么您应该在"Installer->Custom code & Resources“步骤中添加带有编译类的JAR文件。
添加操作时,选择“自定义代码->在自定义代码中搜索操作”,您的操作将以正确的名称显示。

https://stackoverflow.com/questions/52072163
复制相似问题