summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2012-05-14 23:24:25 +0000
committersr55 <[email protected]>2012-05-14 23:24:25 +0000
commitc3e391f2fe94084c2a5ffb221cd1ced0b4c861bf (patch)
tree6b4f3fe904a6717371ed15f95f4a958b2669b1c9 /win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs
parent0a46de5cf236dd05ac9cd18451f2fd23fc6419a7 (diff)
WinGui:
- Fix some stupid code in the CliCheckHelper class which could easily cause it to not set version information. - Fix an issue in the scan service where it could try to write to a log directory which doesn't exist yet leading to no log file being displayed. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4680 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs')
-rw-r--r--win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs15
1 files changed, 10 insertions, 5 deletions
diff --git a/win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs b/win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs
index b663cf2bf..da349c417 100644
--- a/win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs
+++ b/win/CS/HandBrakeWPF/Helpers/CliCheckHelper.cs
@@ -72,14 +72,12 @@ namespace HandBrakeWPF.Helpers
cliProcess.Start();
// Retrieve standard output and report back to parent thread until the process is complete
+ bool success = false;
TextReader stdOutput = cliProcess.StandardError;
-
- while (!cliProcess.HasExited)
+ while ((line = stdOutput.ReadLine()) != null)
{
- line = stdOutput.ReadLine() ?? string.Empty;
Match m = Regex.Match(line, @"HandBrake ([svnM0-9.]*) \(([0-9]*)\)");
Match platform = Regex.Match(line, @"- ([A-Za-z0-9\s ]*) -");
-
if (m.Success)
{
string version = m.Groups[1].Success ? m.Groups[1].Value : string.Empty;
@@ -90,6 +88,7 @@ namespace HandBrakeWPF.Helpers
userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeBuild, buildValue);
userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeVersion, version);
+ success = true;
}
if (platform.Success)
@@ -97,7 +96,10 @@ namespace HandBrakeWPF.Helpers
userSettingService.SetUserSetting(
ASUserSettingConstants.HandBrakePlatform, platform.Value.Replace("-", string.Empty).Trim());
}
+ }
+ while (!cliProcess.HasExited)
+ {
if (cliProcess.TotalProcessorTime.Seconds > 10) // Don't wait longer than 10 seconds.
{
Process cli = Process.GetProcessById(cliProcess.Id);
@@ -108,7 +110,10 @@ namespace HandBrakeWPF.Helpers
}
}
- userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeExeHash, base64Hash);
+ if (success)
+ {
+ userSettingService.SetUserSetting(ASUserSettingConstants.HandBrakeExeHash, base64Hash);
+ }
}
catch (Exception e)
{