2019-07-12 16:33:25 +03:00
|
|
|
package pro.gravit.launchserver.binary;
|
|
|
|
|
|
|
|
import pro.gravit.launchserver.LaunchServer;
|
|
|
|
import pro.gravit.utils.helper.IOHelper;
|
2019-07-12 16:43:56 +03:00
|
|
|
import pro.gravit.utils.helper.LogHelper;
|
2019-07-12 16:33:25 +03:00
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.OutputStream;
|
|
|
|
import java.nio.file.Path;
|
|
|
|
|
|
|
|
public class SimpleEXELauncherBinary extends LauncherBinary {
|
|
|
|
public Path exeTemplate;
|
2019-07-12 16:43:56 +03:00
|
|
|
public SimpleEXELauncherBinary(LaunchServer server) {
|
2019-07-12 16:33:25 +03:00
|
|
|
super(server, LauncherBinary.resolve(server, ".exe"));
|
|
|
|
exeTemplate = server.dir.resolve("SimpleTemplate.exe");
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void build() throws IOException {
|
2019-07-12 16:43:56 +03:00
|
|
|
if(!IOHelper.isFile(exeTemplate))
|
|
|
|
{
|
|
|
|
LogHelper.warning("[SimpleEXEBinary] File %s not found. %s not created", exeTemplate.toString(), syncBinaryFile.toString());
|
|
|
|
return;
|
|
|
|
}
|
2019-07-12 16:33:25 +03:00
|
|
|
try(OutputStream output = IOHelper.newOutput(syncBinaryFile))
|
|
|
|
{
|
|
|
|
IOHelper.transfer(exeTemplate, output);
|
|
|
|
IOHelper.transfer(server.launcherBinary.syncBinaryFile, output);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|