You can test the platform fairly accurately by including the LogicLib.nsh and WinVer.nsh scripts provided by NSIS.
Here is the function I use, where I do some sanity checks before installing the application:
Function CheckUnsupportedPlatform ${if} ${AtLeastWin95} ${AndIf} ${AtMostWinME} ;NT4 and W95 use the same version number, we can use ${IsNT} if we need precise identification MessageBox MB_OK|MB_ICONEXCLAMATION "Sorry, but your version of Windows is unsupported platform.$\n\ Supported platforms are currently 2000 / XP / 2003 / Vista / Seven$\n \ Cannot continue the installation." /SD IDOK abort ${elseIf} ${isWin2008} ${orIf} ${AtLeastWin2008R2} MessageBox MB_OK|MB_ICONINFORMATION "Please note that support for Windows 2008 and Windows 8 is in beta stage.$\n\ Supported platforms are currently 2000 / XP / 2003 / Vista / Seven" /SD IDOK ${endif} FunctionEnd
There are many other possibilities, look again at the WinVer.nsh header.
source share