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

@@ -104,6 +104,20 @@ namespace VRCX
public override string GetVRChatPhotosLocation()
{
var json = ReadConfigFile();
if (!string.IsNullOrEmpty(json))
{
var obj = JsonConvert.DeserializeObject<JObject>(json);
if (obj["picture_output_folder"] != null)
{
var photosDir = (string)obj["picture_output_folder"];
if (!string.IsNullOrEmpty(photosDir) && Directory.Exists(photosDir))
{
return photosDir;
}
}
}
return Path.Join(_vrcPrefixPath, "drive_c/users/steamuser/Pictures/VRChat");
}

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;
}
}
}

View File

@@ -30,6 +30,7 @@ const args = process.argv.slice(1);
const noInstall = args.includes('--no-install');
const x11 = args.includes('--x11');
const noDesktop = args.includes('--no-desktop');
const startup = args.includes('--startup');
const homePath = getHomePath();
tryRelaunchWithArgs(args);
@@ -567,7 +568,7 @@ function tryCopyFromWinePrefix() {
}
function applyWindowState() {
if (VRCXStorage.Get('VRCX_StartAsMinimizedState') === 'true') {
if (VRCXStorage.Get('VRCX_StartAsMinimizedState') === 'true' && startup) {
if (isCloseToTray) {
mainWindow.hide();
return;

View File

@@ -10077,7 +10077,7 @@ console.log(`isLinux: ${LINUX}`);
if (desktopMode) {
args.push('--no-vr');
}
if (vrcLaunchPathOverride) {
if (vrcLaunchPathOverride && !LINUX) {
AppApi.StartGameFromPath(
vrcLaunchPathOverride,
args.join(' ')

View File

@@ -28,6 +28,7 @@
</div>
<el-input
v-if="!isLinux()"
v-model="launchOptionsDialog.vrcLaunchPathOverride"
type="textarea"
placeholder="C:\Program Files (x86)\Steam\steamapps\common\VRChat"
@@ -59,6 +60,7 @@
import configRepository from '../../../service/config';
const openExternalLink = inject('openExternalLink');
const isLinux = inject('isLinux');
const { t } = useI18n();