i am recently looked at jpackage there is any option automatically adds the appilication to startup, For Example consider I have,
App.java
package org.openjfx;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
/**
* JavaFX App
*/
public class App extends Application {
@Override
public void start(Stage stage) {
var label = new Label("Hello, JavaFX");
var scene = new Scene(new StackPane(label), 640, 480);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch();
}
}
module-info.java
module Sample {
requires javafx.controls;
opens org.openjfx;
}
Using maven to generate runtime,
mvn javafx:jlink
Then generate the installer,
jpackage --win-dir-chooser --runtime-image ./target/image/ --name Sample-Javafx --module Sample/org.openjfx.App -d ./target/bin/
This all works fine but what i want is to register App.java at startup and start this app after installation is it possible with jpackage or there is any trick inside App.java to achive this ?
jpackage
, might be to try and do this within your application when it first starts. For instance, on Windows I'm pretty sure startup apps are determined by simply having a shortcut in a specific folder; not sure about other operating systems. – Retaliationjpackage
relies on the wix toolset to build Windows installers. Wix can define services, or add a program to start on boot. It may be possible to customize your build to specify the options you wish so Wix will build the installer you want, but I haven’t enoughjpackage
experience to know that for sure or provide instructions. – Spittle