Don't kill systemd services for portable and improve translations
Gitea/Java-Installer/pipeline/head There was a failure building this commit Details

snapshot
Jonas Letzbor 2023-12-28 21:54:00 +01:00
parent 83d5f8c000
commit 31dcd1ebe8
Signed by: RPJosh
GPG Key ID: 46D72F589702E55A
3 changed files with 13 additions and 11 deletions

View File

@ -405,7 +405,7 @@ public class InstallConfig {
this.isPortable = true; this.isPortable = true;
this.portableMainDir = dir; this.portableMainDir = dir;
this.configDir = dir + "Appdata/"; this.configDir = dir + "AppData/";
this.applicationDir = dir + "Programm/"; this.applicationDir = dir + "Programm/";
isPortable = true; isPortable = true;

View File

@ -243,10 +243,12 @@ public class Installer {
} else if (InstallConfig.getOsType() == OSType.LINUX) { } else if (InstallConfig.getOsType() == OSType.LINUX) {
// If a service was installed previously try to stop it first. This will fail internal when no service was created // If a service was installed previously try to stop it first. This will fail internal when no service was created
Process p = new ProcessBuilder("bash", "-c", "systemctl stop \"" + conf.getApplicationNameShort() + ".service" + "\"").start(); if (!conf.getIsPortable()) {
p.waitFor(5, TimeUnit.SECONDS); Process p = new ProcessBuilder("bash", "-c", "systemctl stop \"" + conf.getApplicationNameShort() + ".service" + "\"").start();
p.waitFor(5, TimeUnit.SECONDS);
}
p = new ProcessBuilder("bash", "-c", "pkill -9 -f '" + conf.getApplicationNameShort() + ".jar'").start(); Process p = new ProcessBuilder("bash", "-c", "pkill -9 -f '" + conf.getApplicationNameShort() + ".jar'").start();
p.waitFor(5, TimeUnit.SECONDS); p.waitFor(5, TimeUnit.SECONDS);
} }
} catch (Exception ex) { /* not required */ } } catch (Exception ex) { /* not required */ }
@ -1191,7 +1193,7 @@ public class Installer {
* that are only needed in edge cases. * that are only needed in edge cases.
*/ */
private void finishInstallation() { private void finishInstallation() {
if (InstallConfig.getOsType() == OSType.LINUX) { if (InstallConfig.getOsType() == OSType.LINUX && !conf.getIsPortable()) {
try { try {
// Try to start a previously installed service again that was stopped during installation // Try to start a previously installed service again that was stopped during installation
Process p = new ProcessBuilder("bash", "-c", "systemctl start \"" + conf.getApplicationNameShort() + ".service" + "\"").start(); Process p = new ProcessBuilder("bash", "-c", "systemctl start \"" + conf.getApplicationNameShort() + ".service" + "\"").start();

View File

@ -1,9 +1,9 @@
root_rights_required=\ root_rights_required=\
For the installation of the program administrator / root privileges are required.\n\n\ Administrator / root rights are required to install this program..\n\n\
If you don't have these you can try to install the program portable or only for the currently logged-in user [Windows].\n\ If you don't have these you can try to install the program portable or only for the currently logged-in user [Windows].\n\
For further help execute the program via the command line with the parameter "--help". For further help, run the Installer via the command line with the parameter "--help".
root_askForRestart=\ root_askForRestart=\
If you do have such rights the installation can be restarted automatically with root privileges.\n\ If you have these rights, the installation can be restarted automatically with root privileges.\n\
Would you like to try a restart of the program with root privileges (Y/N)? Would you like to try a restart of the program with root privileges (Y/N)?
userInstallation_notAvailable=A user installation is only available for windows userInstallation_notAvailable=A user installation is only available for windows
@ -12,8 +12,8 @@ installation_start=Starting the installation of {0} (version {1})
installation_architekture=Determine architecture and operating system installation_architekture=Determine architecture and operating system
installation_download=Downloading file installation_download=Downloading file
installation_download_success=Downloading file: successful downloaded installation_download_success=Downloading file: successfully downloaded
installation_download_invalid=The given file is invalid! installation_download_invalid=The provided file is invalid!
installation_download_failed=An error occurred while downloading the file.\nPlease check your Internet connection and try again later (URL: {0}) installation_download_failed=An error occurred while downloading the file.\nPlease check your Internet connection and try again later (URL: {0})
installation_download_urlNotFound=The determined URL was not found (URL: {0}); installation_download_urlNotFound=The determined URL was not found (URL: {0});
@ -35,6 +35,6 @@ failed=failed
errorMessage=Error Message errorMessage=Error Message
successful=successful successful=successful
basicAuthRequired=For downloading the program a authentication is required (HTTP-Code 401) basicAuthRequired=Authentication is required to download the program (HTTP code 401)
username=Username username=Username
password=Password password=Password