mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 23:03:51 +02:00
Linux: Change how AppImage moving is handled, add support for vrcx:\\
This commit is contained in:
@@ -147,13 +147,6 @@ namespace VRCX
|
||||
Program.VRCXVRInstance.ExecuteVrOverlayFunction(function, json);
|
||||
}
|
||||
|
||||
public override string GetLaunchCommand()
|
||||
{
|
||||
var command = StartupArgs.LaunchArguments.LaunchCommand;
|
||||
StartupArgs.LaunchArguments.LaunchCommand = string.Empty;
|
||||
return command;
|
||||
}
|
||||
|
||||
public override void FocusWindow()
|
||||
{
|
||||
MainForm.Instance.Invoke(new Action(() => { MainForm.Instance.Focus_Window(); }));
|
||||
|
||||
@@ -60,6 +60,13 @@ namespace VRCX
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public string GetLaunchCommand()
|
||||
{
|
||||
var command = StartupArgs.LaunchArguments.LaunchCommand;
|
||||
StartupArgs.LaunchArguments.LaunchCommand = string.Empty;
|
||||
return command;
|
||||
}
|
||||
|
||||
public void IPCAnnounceStart()
|
||||
{
|
||||
|
||||
@@ -21,7 +21,6 @@ namespace VRCX
|
||||
public abstract void ExecuteAppFunction(string function, string json);
|
||||
public abstract void ExecuteVrFeedFunction(string function, string json);
|
||||
public abstract void ExecuteVrOverlayFunction(string function, string json);
|
||||
public abstract string GetLaunchCommand();
|
||||
public abstract void FocusWindow();
|
||||
public abstract void ChangeTheme(int value);
|
||||
public abstract void DoFunny();
|
||||
|
||||
@@ -64,11 +64,6 @@ namespace VRCX
|
||||
{
|
||||
}
|
||||
|
||||
public override string GetLaunchCommand()
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
public override void FocusWindow()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace VRCX
|
||||
{
|
||||
var compatToolMapping = new Dictionary<string, string>();
|
||||
const string sectionHeader = "\"CompatToolMapping\"";
|
||||
int sectionStart = vdfContent.IndexOf(sectionHeader);
|
||||
int sectionStart = vdfContent.IndexOf(sectionHeader, StringComparison.Ordinal);
|
||||
|
||||
if (sectionStart == -1)
|
||||
{
|
||||
@@ -53,7 +53,7 @@ namespace VRCX
|
||||
return compatToolMapping;
|
||||
}
|
||||
|
||||
int blockStart = vdfContent.IndexOf("{", sectionStart) + 1;
|
||||
int blockStart = vdfContent.IndexOf('{', sectionStart) + 1;
|
||||
int blockEnd = FindMatchingBracket(vdfContent, blockStart - 1);
|
||||
|
||||
if (blockStart == -1 || blockEnd == -1)
|
||||
@@ -317,6 +317,12 @@ namespace VRCX
|
||||
{
|
||||
string winePath = GetVRChatWinePath();
|
||||
string winePrefix = _vrcPrefixPath;
|
||||
if (string.IsNullOrEmpty(winePath) || string.IsNullOrEmpty(winePrefix))
|
||||
{
|
||||
logger.Info("VRC Wine path was not found");
|
||||
return null;
|
||||
}
|
||||
|
||||
string wineRegCommand = $"\"{winePath}\" reg {command}";
|
||||
ProcessStartInfo processStartInfo = GetWineProcessStartInfo(winePath, winePrefix, wineRegCommand);
|
||||
using var process = Process.Start(processStartInfo);
|
||||
|
||||
@@ -9,6 +9,7 @@ using NLog.Targets;
|
||||
using System;
|
||||
using System.Data.SQLite;
|
||||
using System.IO;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
|
||||
@@ -224,6 +225,9 @@ namespace VRCX
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
|
||||
logger.Info("{0} Starting...", Version);
|
||||
logger.Info("Args: {0}", JsonSerializer.Serialize(StartupArgs.Args));
|
||||
if (!string.IsNullOrEmpty(StartupArgs.LaunchArguments.LaunchCommand))
|
||||
logger.Info("Launch Command: {0}", StartupArgs.LaunchArguments.LaunchCommand);
|
||||
logger.Debug("Wine detection: {0}", Wine.GetIfWine());
|
||||
|
||||
SQLiteLegacy.Instance.Init();
|
||||
@@ -276,6 +280,9 @@ namespace VRCX
|
||||
Update.Check();
|
||||
|
||||
logger.Info("{0} Starting...", Version);
|
||||
logger.Info("Args: {0}", JsonSerializer.Serialize(StartupArgs.Args));
|
||||
if (!string.IsNullOrEmpty(StartupArgs.LaunchArguments.LaunchCommand))
|
||||
logger.Info("Launch Command: {0}", StartupArgs.LaunchArguments.LaunchCommand);
|
||||
|
||||
AppApiInstance = new AppApiElectron();
|
||||
// ProcessMonitor.Instance.Init();
|
||||
|
||||
@@ -11,6 +11,7 @@ using System.IO.Pipes;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
|
||||
#if !LINUX
|
||||
@@ -24,9 +25,11 @@ namespace VRCX
|
||||
{
|
||||
private const string SubProcessTypeArgument = "--type";
|
||||
public static VrcxLaunchArguments LaunchArguments = new();
|
||||
public static string[] Args;
|
||||
|
||||
public static void ArgsCheck(string[] args)
|
||||
{
|
||||
Args = args;
|
||||
Debug.Assert(Program.LaunchDebug = true);
|
||||
|
||||
LaunchArguments = ParseArgs(args);
|
||||
@@ -77,6 +80,9 @@ namespace VRCX
|
||||
|
||||
if (arg.StartsWith(VrcxLaunchArguments.LaunchCommandPrefix) && arg.Length > VrcxLaunchArguments.LaunchCommandPrefix.Length)
|
||||
arguments.LaunchCommand = arg.Substring(VrcxLaunchArguments.LaunchCommandPrefix.Length);
|
||||
|
||||
if (arg.StartsWith(VrcxLaunchArguments.LinuxLaunchCommandPrefix) && arg.Length > VrcxLaunchArguments.LinuxLaunchCommandPrefix.Length)
|
||||
arguments.LaunchCommand = arg.Substring(VrcxLaunchArguments.LinuxLaunchCommandPrefix.Length);
|
||||
|
||||
if (arg.StartsWith(VrcxLaunchArguments.ConfigDirectoryPrefix) && arg.Length > VrcxLaunchArguments.ConfigDirectoryPrefix.Length)
|
||||
arguments.ConfigDirectory = arg.Substring(VrcxLaunchArguments.ConfigDirectoryPrefix.Length + 1);
|
||||
@@ -96,6 +102,7 @@ namespace VRCX
|
||||
public bool IsDebug { get; set; } = false;
|
||||
|
||||
public const string LaunchCommandPrefix = "/uri=vrcx://";
|
||||
public const string LinuxLaunchCommandPrefix = "vrcx://";
|
||||
public string LaunchCommand { get; set; } = null;
|
||||
|
||||
public const string ConfigDirectoryPrefix = "--config";
|
||||
|
||||
@@ -359,7 +359,6 @@ namespace VRCX
|
||||
public async Task<string> ExecuteJson(string options)
|
||||
{
|
||||
var data = JsonConvert.DeserializeObject<Dictionary<string, object>>(options);
|
||||
Logger.Info(JsonConvert.SerializeObject(data));
|
||||
var result = await Execute(data);
|
||||
return System.Text.Json.JsonSerializer.Serialize(new
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user