Commits vergleichen
Keine gemeinsamen Commits. "f41673e69abf24778b5d7457669f6efc0fbb2163" und "88771145edcf972b5615f23049026681fee7d9f4" haben vollständig unterschiedliche Historien.
f41673e69a
...
88771145ed
11
pom.xml
11
pom.xml
@ -6,12 +6,12 @@
|
||||
|
||||
<groupId>de.chaos</groupId>
|
||||
<artifactId>swlnmngr</artifactId>
|
||||
<version>0.1.3</version>
|
||||
<version>0.1.2</version>
|
||||
<name>SteamWarLinkManager</name>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
@ -98,10 +98,5 @@
|
||||
<artifactId>commons-lang</artifactId>
|
||||
<version>2.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.vatbub</groupId>
|
||||
<artifactId>mslinks</artifactId>
|
||||
<version>1.0.6.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -19,7 +19,7 @@ public class CLIConfig {
|
||||
options.addOption(new Option("d", "debug", false, "Set the Log Level to Debug"));
|
||||
options.addOption(new Option("c", "config", true, "Use another Config File"));
|
||||
options.addOption(new Option("i", "installdir", true, "Use other Install Dir"));
|
||||
options.addOption(new Option("u", "update-checker", false, "Enable the Auto-Update Checker"));
|
||||
options.addOption(new Option("u", "no-update", false, "Disable the Auto-Update Checker"));
|
||||
|
||||
CommandLine cli = null;
|
||||
CommandLineParser parser = new DefaultParser();
|
||||
|
@ -2,7 +2,6 @@ package de.chaos.swlnmngr.route.routes;
|
||||
|
||||
import de.chaos.swlnmngr.Main;
|
||||
import de.chaos.swlnmngr.config.CLIConfig;
|
||||
import mslinks.ShellLink;
|
||||
import org.apache.commons.lang.SystemUtils;
|
||||
import org.json.JSONObject;
|
||||
import org.json.JSONTokener;
|
||||
@ -10,13 +9,9 @@ import org.json.JSONTokener;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.nio.file.StandardOpenOption;
|
||||
import java.nio.file.attribute.FileAttribute;
|
||||
import java.nio.file.attribute.PosixFilePermission;
|
||||
import java.util.Objects;
|
||||
|
||||
public class InstallRoute implements Route {
|
||||
@ -59,30 +54,12 @@ public class InstallRoute implements Route {
|
||||
Main.getLogger().error("Could not create SymLink", e);
|
||||
return false;
|
||||
}
|
||||
} else if(SystemUtils.IS_OS_WINDOWS) {
|
||||
try {
|
||||
ShellLink link = ShellLink.createLink(new File(CLIConfig.INSTALL_DIR, "swlnmngr.bat").getAbsolutePath(), new File(CLIConfig.INSTALL_DIR, "swlnmngr.lnk").getAbsolutePath()).setWorkingDir(CLIConfig.INSTALL_DIR.getAbsolutePath());
|
||||
link.getHeader().getLinkFlags().setRunAsUser();
|
||||
link.saveTo(new File(CLIConfig.INSTALL_DIR, "swlnmngr.lnk").getAbsolutePath());
|
||||
Files.writeString(new File(CLIConfig.INSTALL_DIR, "swlnmngr.bat").toPath(), Files.readString(new File(CLIConfig.INSTALL_DIR, "swlnmngr.bat").toPath()).replace("${iDir}", CLIConfig.INSTALL_DIR.getAbsolutePath()), StandardCharsets.UTF_8, StandardOpenOption.TRUNCATE_EXISTING);
|
||||
} catch (IOException e) {
|
||||
Main.getLogger().error("Could not create Link", e);
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File configFile = new File(installDir, "config.json");
|
||||
if(!configFile.exists()) {
|
||||
try {
|
||||
String configStr = new String(Objects.requireNonNull(InstallRoute.class.getResourceAsStream("/default_config.json")).readAllBytes());
|
||||
if(SystemUtils.IS_OS_WINDOWS) {
|
||||
configStr = configStr.replace("~", System.getProperty("user.home"))
|
||||
.replace("\\", "\\\\")
|
||||
.replace("/", "\\\\")
|
||||
.replace("https:\\\\\\\\steamwar.de\\\\lib.php", "https://steamwar.de/lib.php");
|
||||
}
|
||||
Files.writeString(configFile.toPath(), configStr, StandardOpenOption.CREATE_NEW);
|
||||
Files.copy(Objects.requireNonNull(InstallRoute.class.getResourceAsStream("/default_config.json")), configFile.toPath());
|
||||
} catch (IOException e) {
|
||||
Main.getLogger().error("Could not copy Config File", e);
|
||||
return false;
|
||||
|
@ -34,7 +34,7 @@ public class LinkRoute implements Route {
|
||||
Main.getLogger().error("No Project with name: {}", args[0]);
|
||||
return false;
|
||||
}
|
||||
File link = new File(projectDir, "lib");
|
||||
File link = new File(projectDir, "libs");
|
||||
try {
|
||||
Files.deleteIfExists(link.toPath());
|
||||
Main.getLogger().debug(libsFile);
|
||||
|
@ -1,5 +1 @@
|
||||
set args=--help
|
||||
set /p args=Arguments:
|
||||
echo %args%
|
||||
java -jar ${iDir}\SteamWarLinkManager.jar %args% %*
|
||||
pause
|
||||
java -jar ./SteamWarLinkManager.jar %*
|
In neuem Issue referenzieren
Einen Benutzer sperren