Search This Blog

Monday, April 13, 2020

.netFramework Version checker for NSIS

https://github.com/ReVolly/NsisDotNetChecker

All Users

  1. Copy DotNetChecker.dll to NSIS plugins directory (usually C:\Program Files\Nsis\Plugins\ or C:\Program Files (x86)\Nsis\Plugins\x86-ansi)
  2. Copy DotNetChecker.nsh to NSIS Include directory C:\Program Files (x86)\NSIS\Include
  3. Add to your installer project DotNetChecker.nsh file
  4. Reference DotNetChecker.nsh in your main NSI file like this: !include "DotNetChecker.nsh"
  5. Insert macros with the version of required .NET framework.

Local

  1. Copy the whole project in to the same folder as your NSIS Script.
  2. Refrence the Plugin DLL like this: !addplugindir "NsisDotNetChecker\bin"
  3. Reference DotNetChecker.nsh in your main NSI file like this: !include "NsisDotNetChecker\nsis\DotNetChecker.nsh"

In script

  1.  Added !include DotNetChecker.nsh at the top of the script.
  2.  Added this line into installer section:   
  3. !insertmacro CheckNetFramework 10 - checks for .netframework 1.0
  4. !insertmacro CheckNetFramework 461 - checks for .netframework 4.61
  5. !insertmacro CheckNetFramework 472 - checks for .netframework 4.72
  6. !insertmacro CheckNetFramework 40Client - checks for .netframework 4.0 client
  7. !insertmacro CheckNetFramework 40Full - checks for .netframework 4.0 Full

No comments: