我想从jar文件中启动静态函数,并在安装期间接收它的返回值。有没有其他方法,而不是执行java.exe?
发布于 2012-05-24 05:22:16
我真的不明白投反对票的原因。
您可以通过从InstallAnywhere的CustomCodeAction扩展,在安装过程中运行自定义代码。您所需要做的就是覆盖基类的install和uninstall方法。请找到下面的示例代码片段。
public class MyCustomCodeAction extends CustomCodeAction {
public void install(InstallerProxy proxy) throws InstallException {
// call the static function of your jar here
}
public void uninstall(UninstallerProxy Uproxy) throws InstallException {
// you can do something here if you need (not must)
}
}祝好运!
https://stackoverflow.com/questions/10628308
复制相似问题