Skip to content

Commit 2acb196

Browse files
authored
Merge pull request #198 from pre-martin/fix/improved-streamdeck-folder-detection
Installer: Improved detection of Stream Deck installation folder.
2 parents 4371442 + 03f65e9 commit 2acb196

2 files changed

Lines changed: 20 additions & 9 deletions

File tree

StreamDeckSimHub.Installer/Actions/StartStreamDeckSoftware.cs

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,24 @@ public class StartStreamDeckSoftware : AbstractInstallerAction
1818
protected override Task<ActionResult> ExecuteInternal()
1919
{
2020
var installFolder = GetStreamDeckInstallFolder();
21+
if (!string.IsNullOrEmpty(installFolder))
22+
{
23+
if (File.Exists(Path.Combine(installFolder, "StreamDeck.exe")))
24+
{
25+
SetAndLogInfo($"Found Stream Deck directory in registry and verified executable: \"{installFolder}\"");
26+
}
27+
else
28+
{
29+
SetAndLogInfo($"Found Stream Deck directory in registry \"{installFolder}\", but executable not found. Using default: {Configuration.StreamDeckDefaultInstallFolder}");
30+
installFolder = Configuration.StreamDeckDefaultInstallFolder;
31+
}
32+
}
33+
else
34+
{
35+
SetAndLogInfo($"Could not find Stream Deck directory in registry. Using default: {Configuration.SimHubDefaultInstallFolder}");
36+
installFolder = Configuration.StreamDeckDefaultInstallFolder;
37+
}
38+
2139
var streamDeckExePath = Path.Combine(installFolder, "StreamDeck.exe");
2240
if (!File.Exists(streamDeckExePath))
2341
{
@@ -33,14 +51,7 @@ protected override Task<ActionResult> ExecuteInternal()
3351
private string GetStreamDeckInstallFolder()
3452
{
3553
var installPath = (string)Registry.GetValue(Configuration.StreamDeckRegistryFolder, Configuration.StreamDeckRegistryInstallFolder, null);
36-
if (!string.IsNullOrEmpty(installPath))
37-
{
38-
SetAndLogInfo($"Found Stream Deck directory in registry: {installPath}");
39-
return installPath;
40-
}
41-
42-
SetAndLogInfo($"Could not find Stream Deck directory in registry. Using default: {Configuration.SimHubDefaultInstallFolder}");
43-
return Configuration.StreamDeckDefaultInstallFolder;
54+
return installPath;
4455
}
4556
}
4657
}

StreamDeckSimHub.Installer/Actions/StopStreamDeckSoftware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected override async Task<ActionResult> ExecuteInternal()
4646
}
4747
else
4848
{
49-
SetAndLogInfo("Plugin is not running.");
49+
SetAndLogInfo("Plugin is not running, stopping not required.");
5050
}
5151

5252
SetAndLogInfo("The Stream Deck software stopped.");

0 commit comments

Comments
 (0)