From 6e25ffd730ed1d0c6fbdfce5b1c8b919e80707e3 Mon Sep 17 00:00:00 2001 From: RPJosh Date: Sun, 7 May 2023 14:55:25 +0200 Subject: [PATCH] [Windows] Fix '---background' parameter --- src/main/java/de/rpjosh/installer/InstallConfig.java | 8 ++++---- src/main/java/de/rpjosh/installer/Installer.java | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/rpjosh/installer/InstallConfig.java b/src/main/java/de/rpjosh/installer/InstallConfig.java index 875e4db..687223d 100644 --- a/src/main/java/de/rpjosh/installer/InstallConfig.java +++ b/src/main/java/de/rpjosh/installer/InstallConfig.java @@ -319,12 +319,12 @@ public class InstallConfig { * @param serviceUser the user for the service * @param serviceGroup the group for the service * @param serviceEnvironment the environment variables to set - * @param serviceExecStartPre the commands to execute before the service starts. Use -{@literal <}LaunchScript-{@literal >} to replace it with the real location of the launch script - * @param serviceExecStartPost the commands to execute after the service has started. Use-{@literal <}LaunchScript-{@literal >} to replace the location of the launch script + * @param serviceExecStartPre the commands to execute before the service starts. Use {@literal <}LaunchScript{@literal >} to replace it with the real location of the launch script + * @param serviceExecStartPost the commands to execute after the service has started. Use {@literal <}LaunchScript{@literal >} to replace the location of the launch script * @param serviceTimeout the number of seconds which should been allowed to start / stop the service - * @param serviceType the type of the service -{@literal >} oneshot, simple, exec and forking + * @param serviceType the type of the service {@literal >} oneshot, simple, exec and forking * @param serviceExecStart the start command. Please take in mind that only with the type "oneshot" multiple commands can be specified. - * Use -{@literal <}LaunchScript-{@literal >} to replace it with the real location of the launch script + * Use {@literal <}LaunchScript{@literal >} to replace it with the real location of the launch script * @param serviceExecStop the stop command. Use #LaunchScript# to replace the location of the launch script * @param serviceRestart whether the service should been restarted when the execution failed -{@literal >} on-failure or always * @param serviceRestartSec the number of seconds to wait between a restart diff --git a/src/main/java/de/rpjosh/installer/Installer.java b/src/main/java/de/rpjosh/installer/Installer.java index d969c75..0fb15a6 100644 --- a/src/main/java/de/rpjosh/installer/Installer.java +++ b/src/main/java/de/rpjosh/installer/Installer.java @@ -746,8 +746,9 @@ public class Installer { + "\n" + ":: main programm logic\n" + "SET exitScript=0\n" - + "IF defined programOption if %foreground% == \"falseDefault\" SET foreground=\"true\"\n" + + "IF defined programOption IF %foreground% == \"falseDefault\" SET foreground=\"true\"\n" + "IF %foreground% == \"trueDefault\" SET foreground=\"true\"\n" + + "IF defined background IF %background% == \"true\" SET foreground=\"false\"\n" + "\n" + "IF %stop% == \"true\" (\n" + " wmic PROCESS Where \"name Like '%%java%%' AND CommandLine like '%%" + conf.getApplicationNameShort() + "%%'\" Call Terminate\n"