From dd33de008f177da0e5cbde3fd7ae12e0f0942cff Mon Sep 17 00:00:00 2001
From: Miepee <38186597+Miepee@users.noreply.github.com>
Date: Sun, 14 Nov 2021 18:49:42 +0100
Subject: [PATCH] fix launcher not opening folder
---
AM2RLauncher/AM2RLauncher/CrossPlatformOperations.cs | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/AM2RLauncher/AM2RLauncher/CrossPlatformOperations.cs b/AM2RLauncher/AM2RLauncher/CrossPlatformOperations.cs
index 27ee80d..92ddbe0 100644
--- a/AM2RLauncher/AM2RLauncher/CrossPlatformOperations.cs
+++ b/AM2RLauncher/AM2RLauncher/CrossPlatformOperations.cs
@@ -66,7 +66,7 @@ namespace AM2RLauncher
/// The value from as a string
public static string ReadFromConfig(string property)
{
- if(currentPlatform.IsWinForms)
+ if (currentPlatform.IsWinForms)
{
//we use the configuration manager in order to read `property` from the app.config and then return it
ConnectionStringSettings appConfig = ConfigurationManager.ConnectionStrings[property];
@@ -92,7 +92,7 @@ namespace AM2RLauncher
launcherConfig = XML.Serializer.Deserialize(File.ReadAllText(launcherConfigFilePath));
if (launcherConfig[property] == null)
- return null;
+ return null;
//this uses the indexer, which means, we can use the variable in order to get the property. Look at LauncherConfigXML for more info
return launcherConfig[property]?.ToString();
@@ -207,7 +207,7 @@ namespace AM2RLauncher
//needs quotes otherwise paths with space wont open
if (currentPlatform.IsWinForms)
// And we're using explorer.exe to prevent people from stuffing system commands in here wholesale. That would be bad.
- Process.Start("explorer.exe", $"/select \"{realPath}\"");
+ Process.Start("explorer.exe", "\"{realPath}\"");
// linux only opens the directory bc opening and selecting a file is pain
else if (currentPlatform.IsGtk)
Process.Start("xdg-open", $"\"{realPath}\"");