Share via


DotNetChk.exe

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 installed
1 - FX version 50727.42 is installed

dotnetchk.exe -version="3.0.0.0"
0 - FX version 3.0.0.0 is not installed
1 - FX version 3.0.0.0 is installed

dotnetchk.exe -version="3.0.0.0" -lcid:1033
0 - FX version 3.0.0.0 is not installed
1 - FX version 3.0.0.0 is installed but not langpack for LCID 1033
2 - FX version 3.0.0.0 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>

Comments

  • Anonymous
    February 14, 2006
    The comment has been removed
  • Anonymous
    February 14, 2006
    To my knowledge the exit code from a custom action can not set the exit code for the entire Windows Installer package.

    The exit code for your custom action can indicate failure for the package as a whole, but I don't think you can get the entire MSI to return '1042' when it is done installing.

    I'll follow up with a local expert and repost if I an wrong.

    Thanks,
    -Chris
  • Anonymous
    February 14, 2006
    Thanks for the reply Chris. That makes sense, I'll try something else.
  • Anonymous
    December 29, 2008
    I attempted to run DOTNETCHK.EXE on a PC with Windows 2000 SP4.  It failed because it was looking for a non-existent entry point and gave this message: Procedure Entry Point HelpSetInformation could not be located in Kernel32.dll. If this is going to happen on people's PCs, it sounds like DOTNETCHK.EXE is useless, unless I'm missing something. I posted a query about this on the MSDN .NET Framework Setup forum but nobody addressed the issue of the missing entry point. Michael Bate michaelbate@comcast.net