From 608d03fdab381791aef98ddb53eea09e8f42bb57 Mon Sep 17 00:00:00 2001 From: sr55 Date: Thu, 1 Dec 2011 21:24:36 +0000 Subject: WinGui: Fix VLC detection bug. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4369 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/CS/frmPreview.cs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'win') diff --git a/win/CS/frmPreview.cs b/win/CS/frmPreview.cs index 4251923f3..f070e0503 100644 --- a/win/CS/frmPreview.cs +++ b/win/CS/frmPreview.cs @@ -241,20 +241,24 @@ namespace Handbrake } else { + if (!File.Exists(UserSettingService.GetUserSetting(UserSettingConstants.VLC_Path))) + { + // Attempt to find VLC if it doesn't exist in the default set location. + string vlcPath; - // Attempt to find VLC if it doesn't exist in the default set location. - string vlcPath; - - if (8 == IntPtr.Size || - (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432")))) vlcPath = Environment.GetEnvironmentVariable("ProgramFiles(x86)"); - else vlcPath = Environment.GetEnvironmentVariable("ProgramFiles"); + if (8 == IntPtr.Size || (!String.IsNullOrEmpty(Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432")))) + vlcPath = Environment.GetEnvironmentVariable("ProgramFiles(x86)"); + else + vlcPath = Environment.GetEnvironmentVariable("ProgramFiles"); + if (!string.IsNullOrEmpty(vlcPath)) + { + vlcPath = Path.Combine(vlcPath, "VideoLAN\\VLC\\vlc.exe"); + } - if (!File.Exists(UserSettingService.GetUserSetting(UserSettingConstants.VLC_Path))) - { if (File.Exists(vlcPath)) { - UserSettingService.SetUserSetting(UserSettingConstants.VLC_Path, "C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe"); + UserSettingService.SetUserSetting(UserSettingConstants.VLC_Path, vlcPath); } else { -- cgit v1.2.3