Browse Source

Fix non-macos StartApp filename and args

pull/438/head
ionite34 10 months ago
parent
commit
226dcc9cf2
No known key found for this signature in database
GPG Key ID: B3404C5F3827849B
  1. 4
      CHANGELOG.md
  2. 21
      StabilityMatrix.Core/Processes/ProcessRunner.cs

4
CHANGELOG.md

@ -5,6 +5,10 @@ All notable changes to Stability Matrix will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html). and this project adheres to [Semantic Versioning 2.0](https://semver.org/spec/v2.0.0.html).
## v2.8.0-pre.2
### Fixed
- Fixed Auto-update failing to start new version on Windows and Linux when path contains spaces
## v2.8.0-pre.1 ## v2.8.0-pre.1
### Added ### Added
- Added Package Extensions (Plugins) management - accessible from the Packages' 3-dot menu. Currently supports ComfyUI and A1111. - Added Package Extensions (Plugins) management - accessible from the Packages' 3-dot menu. Currently supports ComfyUI and A1111.

21
StabilityMatrix.Core/Processes/ProcessRunner.cs

@ -34,20 +34,21 @@ public static class ProcessRunner
/// </summary> /// </summary>
public static Process StartApp(string path, ProcessArgs args) public static Process StartApp(string path, ProcessArgs args)
{ {
var startInfo = new ProcessStartInfo();
if (Compat.IsMacOS) if (Compat.IsMacOS)
{ {
var startInfo = new ProcessStartInfo startInfo.FileName = "open";
{ startInfo.Arguments = args.Prepend(path).ToString();
FileName = "open", startInfo.UseShellExecute = true;
Arguments = args.Prepend([path, "--args"]), }
UseShellExecute = true else
}; {
startInfo.FileName = path;
return Process.Start(startInfo) startInfo.Arguments = args;
?? throw new NullReferenceException("Process.Start returned null");
} }
return Process.Start(args.Prepend(path)); return Process.Start(startInfo) ?? throw new NullReferenceException("Process.Start returned null");
} }
/// <summary> /// <summary>

Loading…
Cancel
Save