-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement DependencyChecker #900
Implement DependencyChecker #900
Conversation
…CefSharp dependencies
@jornh @jankurianski @rassilon Any thoughts/comments? (Full disclaimer, first draft is a little rough). |
Yes, I would like that. I do not include Is
An exception with a formatted string sounds good to me. It ensures that an informative message appears in Visual Studio if debugging, and when their app is deployed, it will ensure their exception handling code will log the relevant missing files (as most people will at a minimum log the exception type and message via
Default works for me, and overload seems flexible enough to handle anything weird. Good job BTW 👍 |
Any thoughts on handling this? There are so many dependencies that are only used in specific scenarios. Is it enough to check for
|
…ckDependencies Plan is to use `CefSettings.Locale` and `CefSettings.LocalesDirPath` to infer the users local preferences
For now code is in `CefExample` will eventually be moved into `Cef.Initialize()`
…if dependencies missing Error message needs some work
'The fully qualified path for the resources directory. If this value is empty the cef.pak and/or devtools_resources.pak files must be located in the module directory'
…er then implementing checks in `Cef.Initialize()`
Think I've got something that I'm relatively happy with. Further comments? It's not very well tested yet. |
There's likely to be a few refactoring to |
Should also note that disabling pack loading will cause the scrollbars to become red, known issue. #598 |
/// <param name="resourcesDirPath"></param> | ||
/// <param name="localePackFile">The locale pack file e.g. <see cref="LocalesPackFile"/> </param> | ||
/// <returns>List of missing dependencies, if all present an empty List will be returned</returns> | ||
public static List<string> CheckDependencies(bool checkOptional, bool packLoadingDisabled, string path, string resourcesDirPath, string localePackFile = LocalesPackFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whenever I see gobs of bool parameters I usually think: Are you really sure using a flag enum isn't the correct thing to do here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pack loading is a special case. checkOptional
would be replaced with an enum if we went down that path.
This is looking good. I think the optional dlls fall into these separate catagories:
The flag enum idea would allow you to easily check which set to examine. I don't really care at the moment whether or not the above suggestions are put in the PR before merging though. Bill |
…don't think it's worth spending too much time on though) Use Path.Combine instead of manual string concat
I've added a slightly crude |
Still looking good. |
If we eventually do the flag thing might as well include:
Bill |
} | ||
|
||
builder.AppendLine("Executing Assembly Path:" + path); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could also add an informational reminder in this string about locales\xxxx.pak that explains what they do if we know even though I would never suggest checking for the dependency to exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rassilon Not sure I understand, can you clarify?
Anyone up for taking this for a spin and reporting back? At some point I'd still like to see the |
Merging this one now, if anyone has improvements they wish to make just shout out so we can work out if they are done before |
This is a rough first draft of
DependencyChecker
. Basically loops through list of all Cef/CefSharp dependencies.Creating this PR before I go too far, some questions to be answered I think.
ExecutingAssembly
and allowed an overload so that users can call themselves.Will include an overload for
Cef.Initialize()
that enables/disables the dependency check when I'm happy the other questions have been answered.Resolves #876