Checking a codec means checking a registry value, isn't it?
Here is a link how to write read registry
Read, write and delete from registry with C#[
^]
Search google, you may millions.
Now the question is where to use these codes. You can use
Custom Actions Editor
in your setup project and call these codes in the install or commit events. Install event is better.
These events are in a installer class that you are going to use with the custom action editor. If the codec is not there then you can raise the rollback event.
Now google Custom actions Deployment c#. You might get well detailed microsoft documentations.
Good luck