Linux fixes

This commit is contained in:
Natsumi
2025-05-26 04:38:27 +10:00
parent 8b93bf5d57
commit c9687bd493
5 changed files with 41 additions and 16 deletions

View File

@@ -70,6 +70,26 @@ namespace VRCX
public override bool StartGame(string arguments)
{
try
{
var process = Process.Start(new ProcessStartInfo
{
FileName = "steam",
Arguments = $"-applaunch 438100 {arguments}",
UseShellExecute = false,
});
if (process?.ExitCode == 0)
{
process.Close();
return true;
}
process?.Close();
}
catch (Exception e)
{
logger.Error($"Failed to start VRChat: {e.Message}, attempting to start via Steam path.");
}
try
{
var steamPath = _steamPath;
@@ -104,20 +124,8 @@ namespace VRCX
public override bool StartGameFromPath(string path, string arguments)
{
if (!path.EndsWith(".exe"))
path = Path.Join(path, "launch.exe");
if (!path.EndsWith("launch.exe") || !File.Exists(path))
return false;
Process.Start(new ProcessStartInfo
{
WorkingDirectory = Path.GetDirectoryName(path),
FileName = path,
UseShellExecute = false,
Arguments = arguments
})?.Close();
return true;
// This method is not used
return false;
}
}
}