diff --git a/ShareX/Program.cs b/ShareX/Program.cs index a5a956a..8b2ce99 100644 --- a/ShareX/Program.cs +++ b/ShareX/Program.cs @@ -82,9 +82,8 @@ static void Main(string[] args) // Alert user that ShareX was unable to be found. else { - MessageBox.Show("Unable to find ShareX. Please try running ShareX first, then starting StreamDeck.", "Error in ShareX4StreamDeck", MessageBoxButtons.OK, MessageBoxIcon.Error); + Globals.xpath = null; } - SDWrapper.Run(args); } } diff --git a/ShareX/ScreenRecord.cs b/ShareX/ScreenRecord.cs index 5299c88..2313303 100644 --- a/ShareX/ScreenRecord.cs +++ b/ShareX/ScreenRecord.cs @@ -7,7 +7,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -using System.Windows; +using System.Windows.Forms; using WindowsInput; namespace ShareX @@ -56,6 +56,13 @@ public ScreenRecord(SDConnection connection, InitialPayload payload) : base(conn public override void KeyPressed(KeyPayload payload) { Logger.Instance.LogMessage(TracingLevel.INFO, "Key Pressed"); + + if (Globals.xpath == null) + { + MessageBox.Show("Unable to find ShareX. Please try running ShareX first, then starting StreamDeck.", "Error in ShareX4StreamDeck", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + if (inputRunning) { return; diff --git a/ShareX/Screenshot.cs b/ShareX/Screenshot.cs index d83289a..4e16cd0 100644 --- a/ShareX/Screenshot.cs +++ b/ShareX/Screenshot.cs @@ -7,7 +7,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -using System.Windows; +using System.Windows.Forms; using WindowsInput; namespace ShareX @@ -56,6 +56,12 @@ public Screenshot(SDConnection connection, InitialPayload payload) : base(connec public override void KeyPressed(KeyPayload payload) { Logger.Instance.LogMessage(TracingLevel.INFO, "Key Pressed"); + + if (Globals.xpath == null) + { + MessageBox.Show("Unable to find ShareX. Please try running ShareX first, then starting StreamDeck.", "Error in ShareX4StreamDeck", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } if (inputRunning) { return; diff --git a/ShareX/Workflow.cs b/ShareX/Workflow.cs index c8671fb..9cf4513 100644 --- a/ShareX/Workflow.cs +++ b/ShareX/Workflow.cs @@ -7,7 +7,7 @@ using System.Text; using System.Threading; using System.Threading.Tasks; -using System.Windows; +using System.Windows.Forms; using WindowsInput; namespace ShareX @@ -56,6 +56,12 @@ public Workflow(SDConnection connection, InitialPayload payload) : base(connecti public override void KeyPressed(KeyPayload payload) { Logger.Instance.LogMessage(TracingLevel.INFO, "Key Pressed"); + if (Globals.xpath == null) + { + MessageBox.Show("Unable to find ShareX. Please try running ShareX first, then starting StreamDeck.", "Error in ShareX4StreamDeck", MessageBoxButtons.OK, MessageBoxIcon.Error); + return; + } + if (inputRunning) { return; diff --git a/ShareX/manifest.json b/ShareX/manifest.json index 9241d1f..85edeae 100644 --- a/ShareX/manifest.json +++ b/ShareX/manifest.json @@ -51,7 +51,7 @@ "Name": "ShareX", "Icon": "Images/pluginIcon", "URL": "https://reedhaffner.com/", - "Version": "1.3", + "Version": "1.3.1", "CodePath": "com.reedhaffner.sharex", "Category": "ShareX", "CategoryIcon": "Images/categoryIcon",