I would like to catch this and put it front & center under the user's nose.
The 'simplest' fix is to put some code in InitCanon, but that is run by both the GUI and the CameraControlCmd programs (also CameraControlRemoteCmd). So in CameraDeviceManager.cs's InitCanon() I would need to do a Console.WriteLine() for one case and some kind of message box for the other...
So what's the feeling about adding using System.Window and this:
Code: Select all
catch (Exception exception)
{
Log.Error("Unable init canon driver", exception);
/* Give specific guidance if the error is a missing DLL */
if ((exception.InnerException != null) && (exception.InnerException.Message != null) && (exception.InnerException.Message.Contains("EDSDK.dll")))
{
/* one or the other */
if (Process.GetCurrentProcess().ProcessName.Equals("CameraControl"))
{
MessageBoxResult result = MessageBox.Show("Canon EOS camera library, EDSDK.dll is missing\nInstall it after downloading from Canon's site\n\nDo you want to close this application?\n\n(You can try to continue, but it probably will not not work)", "Critical Error", MessageBoxButton.YesNo, MessageBoxImage.Question);
if (result == MessageBoxResult.Yes)
{
Application.Current.Shutdown();
}
} else
{
Console.WriteLine("\n**CRITICAL ERROR**\n\nCanon EOS camera library, EDSDK.dll is missing\nInstall it after downloading from Canon's site\n");
}
}
}