简体   繁体   English

生成执行批处理文件的 install4j 应用程序启动器

[英]Generate install4j application launcher, that executes batch file

I have a legacy Batch-File that starts up my application after doing some configuration.我有一个遗留的批处理文件,它在进行一些配置后启动我的应用程序。 Trying to migrate to install4j i ran into the problem, that i cannot generate a launcher that only executes the batch file and gives me all the perks a generated launcher would offer.尝试迁移到 install4j 时遇到了问题,我无法生成仅执行批处理文件并为我提供生成的启动器将提供的所有特权的启动器。

The current (pretty ugly tbh) workaround is to package a separate executable jar that wraps the execution of the script and can be used by install4j to generate the launcher.当前(相当丑陋的 tbh)解决方法是 package 一个单独的可执行文件 jar 包装脚本的执行并且可以被 install4j 用来生成启动器。

public static void main(String[] args) {
    try {
        Runtime.getRuntime().exec("wscript " + BOOTSTRAP_SCRIPT);
    } catch (Exception e) {
        e.printStackTrace();
    }
}

Is there a way to do this with install4j without wrapping the script call?有没有办法在不包装脚本调用的情况下使用 install4j 做到这一点?

You can use a custom installer application instead of a generated launcher.您可以使用自定义安装程序应用程序而不是生成的启动器。 Under "Installer->Screens & actions", add an empty installer application and to its startup node add a "Run executable" action that starts the batch script.在“安装程序->屏幕和操作”下,添加一个空的安装程序应用程序,并在其启动节点中添加一个“运行可执行”操作来启动批处理脚本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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