Monday, July 28, 2014

NSISDotNetChecker plugin for installing the .NET framework if not found

The free Microsoft Visual Studio Express versions do not come with built-in Setup and Deployment wizards so if an installer is required then alternative commercial or free tools must be used. One such free tool I found is the Nullsoft Scriptable Install System (NSIS) which can be downloaded from http://nsis.sourceforge.net/Main_Page.

Using NSIS is a little more inconvenient than using Microsoft Visual Studio's Setup and Deployment project - for one thing files and dependencies must be typed into a script file, and the .NET framework dependency must be handled manually.

I found a NSIS plug-in for checking and installing the .NET framework from this web site https://github.com/ProjectHuman/NsisDotNetChecker. Just follow the instructions on the website to install it on your machine and use it in the NSIS script. However, the script DotNetChecker.nsh that you have to include in your script has a problem and must be edited. If the DotNetChecker.nsh script is used as is, then your installer will never be able to detect and install the .NET framework.

The following change must be made to the DotNetChecker.nsh include script.

  1. Open up the file DotNetChecker.nsh in a text editor.


  2. Locate the following line:

    ${If} $0 == "false"
  3. Replace false with f as shown below:

    ${If} $0 == "f"
  4. Save and close the file.
Now the installer built with this modified DotNetChecker.nsh script will be able to detect and install the .NET framework if necessary.

1 comment:

Anonymous said...

Wow,

This tip was amazing. So happy that I found it as soon as I Googled it.

Was so disappointed the initially cuz the plug-in without the mentioned modification lets the installer pass no matter what.

Thanks again.

PS: Hope somebody let the developer know about this issue.