优化开机自启逻辑

This commit is contained in:
yang 2022-10-16 15:26:10 +08:00
parent 0ebf931235
commit bd3dc18fce
2 changed files with 6 additions and 1 deletions

Binary file not shown.

View File

@ -35,9 +35,14 @@ public class AutoStartFile {
StringJoiner fileContentJoiner = new StringJoiner("\n");
String driveLetter = AUTO_START_EXEC_FILE_PATH.substring(0, 2);
fileContentJoiner.add("@echo off");
fileContentJoiner.add("if exist \"" + AUTO_START_EXEC_FILE_PATH + "RoomIt.exe\" (");
fileContentJoiner.add(driveLetter);
fileContentJoiner.add("cd " + ResourceUtils.getResourceByProject(""));
fileContentJoiner.add("cd " + AUTO_START_EXEC_FILE_PATH);
fileContentJoiner.add("start /b RoomIt");
fileContentJoiner.add(") else (");
fileContentJoiner.add("exit");
fileContentJoiner.add(")");
String fileContent = fileContentJoiner.toString();
File startUpFile = new File(START_UP_FILE_PATH);