forked from tModLoader/tModLoader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMacInfo.java
46 lines (44 loc) · 1.57 KB
/
MacInfo.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
import java.io.File;
public class MacInfo {
public static void main(String[] args) {
String path = System.getenv("HOME");
File directory = null;
if (path != null) {
directory = getInstallDir(path);
}
String[] files = new String[]
{
"tModLoader.exe",
"tModLoaderServer.exe",
"tModLoaderServer",
"Terraria",
"tModLoader",
"tModLoader-kick",
"tModLoader-mono",
"I18N.dll",
"I18N.West.dll",
"libMonoPosixHelper.dylib"
};
String[] filesToDelete = new String[]
{
"Terraria.exe.config",
"mono/config",
"MP3Sharp.dll",
"Ionic.Zip.Reduced.dll",
"Mono.Cecil.dll"
};
Installer.tryInstall(files, filesToDelete, directory, false);
}
private static File getInstallDir(String homeDir) {
File file = new File(homeDir, "Library");
file = new File(file, "Application Support");
file = new File(file, "Steam");
file = new File(file, "steamapps");
file = new File(file, "common");
file = new File(file, "Terraria");
file = new File(file, "Terraria.app");
file = new File(file, "Contents");
file = new File(file, "MacOS");
return file;
}
}