I've recently updated a Windows desktop application from having a dependency on OpenCV 3 to OpenCV 4, and have discovered that OpenCV versions 3.4 and above, on Windows, have a dependency on Microsoft's "Windows Media Feature Pack". This feature is not installed by default on distributions Windows 10N, Windows 10KN, Windows 11N, and Windows 11KN.
Common advice is to install the Media Feature Pack manually via the control panel, Apps > Apps and Features > Optional Features > Add a Feature. This works for end users but what is the best practice when implementing an installer with this dependency? Should the installer just detect that Media Feature Pack is not available via the registry and error out or is there a way to install it programmatically?