I have the following setup: An application is installed via a zip-archive on a users PC. This application has an integrated updater, which will load and overwrite files from a server. The application uses LoadLibrary to load several (required) plugins, which may also be updated by the updater.
Generally, this works, but I got some crash-reports due to "An Application Control policy has blocked this file" error returned from LoadLibrary, which one user said happened after the updater ran, and disappeared after a system restart.
Does anyone know what part of Windows may be causing such an issue? I've found several postsof users/developers experiencing a similar issue, but found no mention of the actual cause, nor an actual solution other than "restart the PC" - which is not a general solution. Furthermore, I am unable to replicate this on any of the machines I have access to, making it even harder to work with.
I'm suspecting it's some kind of caching/security feature, so at least knowing how to turn it on my machine would be helpful in working around it (even if no-one knows a direct solution).
Just for additional reference of the technical details of the updater, the new DLL is loaded in a temporary directory, and then copyied over to the existing file using this function:
void copy(sys::StringView strInName, sys::StringView strOutName)
{
std::error_code error;
std::filesystem::copy_file(strInName.ToString(), strOutName.ToString(), std::filesystem::copy_options::overwrite_existing, error);
if (error)
throw FileException("Failed to copy file from '{}' to '{}': {}"_fmt(strInName, strOutName, error.message()));
}