Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use relative paths in Process proc #3

Closed
SoyRA opened this issue Jul 17, 2021 · 0 comments
Closed

Use relative paths in Process proc #3

SoyRA opened this issue Jul 17, 2021 · 0 comments
Labels
✔️ Confirmed Issues marked with this label were acknowledged and confirmed by the developer. ✨ Enhancement Issues marked with this label indicate further enhancements to the program, such as new features.

Comments

@SoyRA
Copy link
Owner

SoyRA commented Jul 17, 2021

Enhancement

Purpose

Literally almost everything is using relative paths, but the Process proc uses absolute paths.
  * And the simpler and shorter everything is, the better: CMD string limitation and Path length limitation.

Solution

⚠️ I'll have to test this, I assume it will work but anything is possible. e,e
Once the working directory is defined, relative paths can be used. So I would have to change this:

public void procRun(int GameSel, String InjFile, String GameFile, String GameArgs, String GamePath) {
readData.gameSel = GameSel;
if (readData.iniEF("Symlinks").equals("1")) {
InjFile = readData.getPath()+"\\"+InjFile;
GameFile = readData.getPath()+"\\"+GameFile;
GamePath = readData.getPath();
} else {
GamePath = readData.iniGP();
}
if (GameArgs == null) {
GameArgs = readData.iniGA();
} else {
GameArgs = GameArgs + " " + readData.iniGA();
}
try {
Process proc = Runtime.getRuntime().exec(new String[] {"CMD", "/C", InjFile, GameFile, GameArgs}, null, new File(GamePath)); // Runs the Injector##.exe with everything the user has typed in.

- Remove GamePath and if symlinks else
- Use new File("./")

String GamePath, TargetPath = readData.getPath(), gameSel;

- Use TargetPath = "./" unless the ideal way is to remove it and manually change all of them to "./"

@SoyRA SoyRA added ✨ Enhancement Issues marked with this label indicate further enhancements to the program, such as new features. ✔️ Confirmed Issues marked with this label were acknowledged and confirmed by the developer. labels Jul 17, 2021
SoyRA added a commit that referenced this issue Jul 18, 2021
@SoyRA SoyRA closed this as completed Jul 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✔️ Confirmed Issues marked with this label were acknowledged and confirmed by the developer. ✨ Enhancement Issues marked with this label indicate further enhancements to the program, such as new features.
Projects
None yet
Development

No branches or pull requests

1 participant