Added support for different locations of SpotifyWebHelper.exe

This commit is contained in:
mrnikbobjeff 2015-10-16 13:54:39 +02:00
parent bc384b8a52
commit 861f4e5969

View File

@ -254,7 +254,7 @@ namespace SpotifyAPI.Local
/// </summary> /// </summary>
public static void RunSpotify() 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")); Process.Start(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"spotify\spotify.exe"));
} }
@ -263,8 +263,14 @@ namespace SpotifyAPI.Local
/// </summary> /// </summary>
public static void RunSpotifyWebHelper() 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")); 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"));
}
}
} }
} }