I have had a lot of questions from Bootstrapper users about how to check if the .Net Framework is installed on the target system or not. Although we are discussing adding a new InstallCondition into the Bootstrapper for Orcas, the way to check using Visual Studio 2005 is to use the application dotnetchk.exe.
Dotnetchk.exe (a package file for the DotNetFX Bootstrapper package) is an application designed to be used as an ExternalCheck to determine if a particular version of the .Net Framework is installed on a computer.
Here are the various command line parameters and possible exit codes:
dotnetchk.exe 0 - FX version 50727.42 is not installed1 - FX version 50727.42 is installed
dotnetchk.exe -version="126.96.36.199"0 - FX version 188.8.131.52 is not installed1 - FX version 184.108.40.206 is installeddotnetchk.exe -version="220.127.116.11" -lcid:10330 - FX version 18.104.22.168 is not installed1 - FX version 22.214.171.124 is installed but not langpack for LCID 10332 - FX version 126.96.36.199 and langpack is installed
Here is a brief snippet of how the .Net Framework 2.0 Bootstrapper package uses the dotnetchk:<PackageFiles CopyAllPackageFiles="false"> <PackageFile Name="dotnetchk.exe"/></PackageFiles><Command PackageFile="dotnetfx.exe"> <InstallConditions> <BypassIf Property="DotNetInstalled" Compare="ValueNotEqualTo" Value="0"/> </InstallConditions></Command>