简体   繁体   中英

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.

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.

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?

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.

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