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
+14
View File
@@ -104,6 +104,20 @@ namespace VRCX
public override string GetVRChatPhotosLocation() 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"); return Path.Join(_vrcPrefixPath, "drive_c/users/steamuser/Pictures/VRChat");
} }
+22 -14
View File
@@ -70,6 +70,26 @@ namespace VRCX
public override bool StartGame(string arguments) 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 try
{ {
var steamPath = _steamPath; var steamPath = _steamPath;
@@ -104,20 +124,8 @@ namespace VRCX
public override bool StartGameFromPath(string path, string arguments) public override bool StartGameFromPath(string path, string arguments)
{ {
if (!path.EndsWith(".exe")) // This method is not used
path = Path.Join(path, "launch.exe"); return false;
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;
} }
} }
} }
+2 -1
View File
@@ -30,6 +30,7 @@ const args = process.argv.slice(1);
const noInstall = args.includes('--no-install'); const noInstall = args.includes('--no-install');
const x11 = args.includes('--x11'); const x11 = args.includes('--x11');
const noDesktop = args.includes('--no-desktop'); const noDesktop = args.includes('--no-desktop');
const startup = args.includes('--startup');
const homePath = getHomePath(); const homePath = getHomePath();
tryRelaunchWithArgs(args); tryRelaunchWithArgs(args);
@@ -567,7 +568,7 @@ function tryCopyFromWinePrefix() {
} }
function applyWindowState() { function applyWindowState() {
if (VRCXStorage.Get('VRCX_StartAsMinimizedState') === 'true') { if (VRCXStorage.Get('VRCX_StartAsMinimizedState') === 'true' && startup) {
if (isCloseToTray) { if (isCloseToTray) {
mainWindow.hide(); mainWindow.hide();
return; return;
+1 -1
View File
@@ -10077,7 +10077,7 @@ console.log(`isLinux: ${LINUX}`);
if (desktopMode) { if (desktopMode) {
args.push('--no-vr'); args.push('--no-vr');
} }
if (vrcLaunchPathOverride) { if (vrcLaunchPathOverride && !LINUX) {
AppApi.StartGameFromPath( AppApi.StartGameFromPath(
vrcLaunchPathOverride, vrcLaunchPathOverride,
args.join(' ') args.join(' ')
@@ -28,6 +28,7 @@
</div> </div>
<el-input <el-input
v-if="!isLinux()"
v-model="launchOptionsDialog.vrcLaunchPathOverride" v-model="launchOptionsDialog.vrcLaunchPathOverride"
type="textarea" type="textarea"
placeholder="C:\Program Files (x86)\Steam\steamapps\common\VRChat" placeholder="C:\Program Files (x86)\Steam\steamapps\common\VRChat"
@@ -59,6 +60,7 @@
import configRepository from '../../../service/config'; import configRepository from '../../../service/config';
const openExternalLink = inject('openExternalLink'); const openExternalLink = inject('openExternalLink');
const isLinux = inject('isLinux');
const { t } = useI18n(); const { t } = useI18n();