forked from tModLoader/tModLoader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWindowsInfo.java
47 lines (45 loc) · 1.42 KB
/
WindowsInfo.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import java.io.*;
public class WindowsInfo
{
public static void main(String[] args)
{
String path = System.getenv("ProgramFiles(x86)");
File directory = null;
if (path != null)
{
directory = getInstallDir(path);
}
if (directory == null || !directory.exists())
{
path = System.getenv("ProgramFiles");
if (path != null)
{
directory = getInstallDir(path);
}
}
String[] files = new String[]
{
"Terraria.exe",
"ModCompile/tModLoaderMac.exe",
"tModLoaderServer.exe",
"ModCompile/FNA.dll",
"ModCompile/Microsoft.CodeAnalysis.dll",
"ModCompile/Microsoft.CodeAnalysis.CSharp.dll",
"ModCompile/Mono.Cecil.Pdb.dll",
"ModCompile/System.Reflection.Metadata.dll",
"ModCompile/RoslynWrapper.dll",
"start-tModLoaderServer.bat",
"start-tModLoaderServer-steam-friends.bat",
"start-tModLoaderServer-steam-private.bat"
};
Installer.tryInstall(files, directory);
}
private static File getInstallDir(String programFileDir)
{
File file = new File(programFileDir, "Steam");
file = new File(file, "steamapps");
file = new File(file, "common");
file = new File(file, "Terraria");
return file;
}
}