From 861f4e59694dd13784ffbc0545718a4159364fec Mon Sep 17 00:00:00 2001 From: mrnikbobjeff Date: Fri, 16 Oct 2015 13:54:39 +0200 Subject: [PATCH] Added support for different locations of SpotifyWebHelper.exe --- SpotifyAPI/Local/SpotifyLocalAPI.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/SpotifyAPI/Local/SpotifyLocalAPI.cs b/SpotifyAPI/Local/SpotifyLocalAPI.cs index 8c4d16c6..40c8bffa 100644 --- a/SpotifyAPI/Local/SpotifyLocalAPI.cs +++ b/SpotifyAPI/Local/SpotifyLocalAPI.cs @@ -254,7 +254,7 @@ namespace SpotifyAPI.Local /// public static void RunSpotify() { - if (!IsSpotifyRunning()) + if (!IsSpotifyRunning() && File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"spotify\spotify.exe"))) Process.Start(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"spotify\spotify.exe")); } @@ -263,8 +263,14 @@ namespace SpotifyAPI.Local /// public static void RunSpotifyWebHelper() { - if (!IsSpotifyWebHelperRunning()) + if (!IsSpotifyWebHelperRunning() && File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"spotify\data\spotifywebhelper.exe"))) + { Process.Start(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"spotify\data\spotifywebhelper.exe")); + } + else if (!IsSpotifyWebHelperRunning() && File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"spotify\spotifywebhelper.exe"))) + { + Process.Start(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"spotify\spotifywebhelper.exe")); + } } } }