添加了代理命令(包装命令)#173
Conversation
| @@ -394,9 +402,11 @@ public override async Task<LaunchResult> LaunchTaskAsync(LaunchSettings settings | |||
| else | |||
| { | |||
| var normalJavaPath = java!.JavaPath.Replace("javaw", "java", StringComparison.OrdinalIgnoreCase); | |||
There was a problem hiding this comment.
Not related to this pr but @laolarou726 what's this? what if the path is "myjavawow/javaw.exe"? as a launcher core i think we should exactly use the given path. the problem that users might accidently select javaw should be addressed by the user inferface part.
| var javaCommand = $"\"{normalJavaPath}\" {string.Join(' ', arguments)}"; | ||
| var javaCommand = string.IsNullOrWhiteSpace(commandProxy) | ||
| ? $"\"{normalJavaPath}\" {string.Join(' ', arguments)}" | ||
| : $"\"{commandProxy}\" \"{normalJavaPath}\" {string.Join(' ', arguments)}"; |
There was a problem hiding this comment.
Perhaps we shouldn't use " for commandProxy, as it might be something like dotnet run
There was a problem hiding this comment.
By the way, what about to use a commandFormat instead of commandProxy? For example we could directly change the format to "prime-run {java} even to put something here {args} maybe something more".
There was a problem hiding this comment.
阿巴阿巴()好像说太多了()木有为难的意思,现在这样也可以()我先approve了()
There was a problem hiding this comment.
Perhaps we shouldn't use
"forcommandProxy, as it might be something likedotnet run
我想的是,如果用的是/path to/file这样的格式,应该考虑双引号封一起,不然路径有问题。至于dotnet run这种就不太好处理,这个要用dotnet作为程序主体吧,然后run 其他参数。其实也可以是分成代理命令主体和代理命令参数两个部分。但是这样要是用ls | grep 之类的管道符就很复杂了吧。一般就用一个prime-run,问题应该不大
There was a problem hiding this comment.
By the way, what about to use a
commandFormatinstead ofcommandProxy? For example we could directly change the format to"prime-run {java} even to put something here {args} maybe something more".
或许是可行的办法,在useShellExecute的时候通过,在不使用的情况下需要确定命令的主体
预期目标 What does the pull request do
检查清单 Checklist
关联事件 Related
补充说明 Additional Information
无 N/A
PR-Codex overview
This PR introduces a new property and modifies the process launching logic to support a command proxy in
LaunchSettings. It enhances the flexibility of game launching by allowing an alternative command to be specified.Detailed summary
CommandProxyproperty toLaunchSettings.ProcessStartInfo psiwithProcessStartInfo processStartInfo.CommandProxy.processStartInfo.