Should I use the chk or fre KMDF coinstaller?

This has been asked quite a few times and is a major point of confusion for KMDF developers.  The KMDF coinstaller comes in 2 flavors, chk and fre.  Both flavors reside in the same directory in the WDK (winddk\6000\redist\wdf\<arch>) and have their own unique filenames (fre is WdfCoInstaller01005.dll, chk is WdfCoInstaller01005_chk.dll). You have to decide which flavor you want to use, but how do you decide?

The flavor of the coinstaller needs to match the flavor of the operating system you are installing on and not the flavor of your driver. 95% of the time this means you should use the fre flavor of the coinstaller.  The only time you should use the chk coinstaller is if you installed a chk build of the OS itself.  Let me reiterate, just because you compiled a chk version of your driver does not mean you have to use the chk version of the coinstaller.  Furthermore, you should never publicly deploy the chk version of the coinstaller since your customers will not have a chk build of the OS.

How can you tell that you using the wrong flavor of the coinstaller?  Well first of all, the install will fail so if your driver has already been successfully installed, you have nothing more to worry about ;).  Upon failure, look in setupact.log for your device's install entry.  You will find text that appears similar to this:

     WdfCoInstaller: [11/14/2006 11:13.59.430] Update process returned error code 
    :error(1603) Fatal error during installation.
    . Possible causes are running free version of coinstaller on checked version of 
    OS or vice versa. Look at the Kmdf documentation as to what steps need to be 
    followed to install the correct versionof the coinstaller  

and in wdf01005inst.log you will find an entry similar to this text

     0.078: Wdf01005 Setup encountered an error:  Setup cannot continue because one 
    or more prerequisites required to install Wdf01005 failed. For More details 
    check the Log File c:\windows\Wdf01005Inst.log