Hi all. I noticed several people in this forum mentioned creating installers that needed to know the OS version and such, and I know there were certain ways given to determine basic differences (between Win9X and WinNT types) by searching for registry keys and the like, but I thought I'd give a go at creating an actual command for this kind of thing. Here is the result:

IfOSVersion comparison_operator OS_Version[:Service_Pack][|OS_Version[:Service_Pack]][...] label_to_goto_if_comparison_is_true [label_to_goto_otherwise]

valid identifiers:
comparison_operator(=,!=,<,>,<=,>=)
OS_Version(OS_WIN31|OS_WINNT35|OS_WINNT351|OS_WIN95|OS_WINNT4|OS_WIN98|OS_WINME|OS_WIN2000|OS_WINXP|OS_9XFAMILY|OS_NTFAMILY)Service_Pack(SP_1|SP_2|SP_3|SP_4|SP_5|SP_6|SP_7|SP_8|SP_9|SP_10)

This command gives you full conditional install control and the ability to tailor an install to any of the different kinds of Windows operating systems. You can use it in the .onInit function to make sure the user's OS is one that can be installed on, and/or in any other function/section of your script.

With this feature compiled in, it increases the size of a compiled exe by about 1k, so I don't know if this feature needs to be optional (defined in config.h) or not. I guess Justin can decide.

Here is a script that explains more fully the abilities of this function

Here is this script compiled
Of course, you won't be able to compile it unless you get a version of NSIS with my code in it. I'm going to send the code to Justin later today.

-Davison