Making the initial stuff working, getting an installer, when running from VS.

This commit is contained in:
Krom, Robertus 2020-02-04 15:29:10 +01:00
commit 57e2044839
1023 changed files with 20896 additions and 19456 deletions

View file

@ -183,16 +183,15 @@ namespace GreenshotOCR {
RedirectStandardOutput = true,
UseShellExecute = false
};
using (Process process = Process.Start(processStartInfo)) {
if (process != null)
{
process.WaitForExit(30 * 1000);
if (process.ExitCode == 0) {
text = process.StandardOutput.ReadToEnd();
}
}
}
} catch (Exception e) {
using Process process = Process.Start(processStartInfo);
if (process != null)
{
process.WaitForExit(30 * 1000);
if (process.ExitCode == 0) {
text = process.StandardOutput.ReadToEnd();
}
}
} catch (Exception e) {
Log.Error("Error while calling Microsoft Office Document Imaging (MODI) to OCR: ", e);
} finally {
if (File.Exists(filePath)) {
@ -222,15 +221,15 @@ namespace GreenshotOCR {
}
private bool HasModi() {
try {
using (Process process = Process.Start(_ocrCommand, "-c")) {
if (process != null)
{
process.WaitForExit();
return process.ExitCode == 0;
}
}
} catch(Exception e) {
try
{
using Process process = Process.Start(_ocrCommand, "-c");
if (process != null)
{
process.WaitForExit();
return process.ExitCode == 0;
}
} catch(Exception e) {
Log.DebugFormat("Error trying to initiate MODI: {0}", e.Message);
}
Log.InfoFormat("No Microsoft Office Document Imaging (MODI) found, disabling OCR");