Compare commits

...

2 Commits
2.0.2 ... 2.0.4

Author SHA1 Message Date
zznty
a426ad9e02 fix steam redist missing on automatic download 2023-04-22 21:22:46 +07:00
zznty
ba75b1583a do not copy dlls in service mode as it can mess up with runtimes 2023-04-22 18:30:02 +07:00
2 changed files with 21 additions and 12 deletions

View File

@@ -30,7 +30,8 @@ namespace Torch.Server
private const string TOOL_DIR = "tool"; private const string TOOL_DIR = "tool";
private const string TOOL_ZIP = "temp.zip"; private const string TOOL_ZIP = "temp.zip";
private static readonly string TOOL_EXE = "DepotDownloader.exe"; private static readonly string TOOL_EXE = "DepotDownloader.exe";
private const string TOOL_ARGS = "-app 298740 -depot 298741 -dir \"{0}\""; private const string TOOL_ARGS = "-app 298740 -depot {1} -dir \"{0}\"";
private static readonly int[] Depots = { 298741, 1004 };
private TorchServer _server; private TorchServer _server;
internal Persistent<TorchConfig> ConfigPersistent { get; } internal Persistent<TorchConfig> ConfigPersistent { get; }
@@ -160,9 +161,16 @@ namespace Torch.Server
} }
log.Info("Checking for DS updates."); log.Info("Checking for DS updates.");
foreach (var depot in Depots)
{
await DownloadDepot(depot);
}
async Task DownloadDepot(int depotId)
{
var steamCmdProc = new ProcessStartInfo(steamCmdExePath) var steamCmdProc = new ProcessStartInfo(steamCmdExePath)
{ {
Arguments = string.Format(TOOL_ARGS, configuration.GetValue("gamePath", "../")), Arguments = string.Format(TOOL_ARGS, configuration.GetValue("gamePath", "../"), depotId),
WorkingDirectory = path, WorkingDirectory = path,
RedirectStandardOutput = true RedirectStandardOutput = true
}; };
@@ -175,4 +183,5 @@ namespace Torch.Server
} }
} }
} }
}
} }

View File

@@ -47,7 +47,7 @@ namespace Torch.Utils
private static void CopyNative() private static void CopyNative()
{ {
if (ApplicationContext.Current.GameFilesDirectory.Attributes.HasFlag(FileAttributes.ReadOnly)) if (ApplicationContext.Current.IsService || ApplicationContext.Current.GameFilesDirectory.Attributes.HasFlag(FileAttributes.ReadOnly))
{ {
Log.Warn("Torch directory is readonly. You should copy steam_api64.dll, Havok.dll from bin manually"); Log.Warn("Torch directory is readonly. You should copy steam_api64.dll, Havok.dll from bin manually");
return; return;