Skip to content
⌘ NSIS Forum Archive

Detecting NT

3 posts

lewellyn#

Detecting NT

I'm trying to detect whether a user is trying to install under NT/2K/XP/etc., and abort with an error if so. What is the proper way to do this? I searched and ended putting the following in .onInit:

ReadRegStr $0 HKLM SOFTWARE\Microsoft\Windows\CurrentVersion VersionNumber
StrCmp $0 "" 0  +2
MessageBox MB_OK|MB_ICONEXCLAMATION "This program is for Windows 95/98/Me only" 
Abort 
This causes the error to pop up when it should. This is good. However, the installer just quits under 95/98/Me. This is not good, as these are the only supported platforms. :weird

Any ideas as to what I may be doing wrong?
lewellyn#
Originally posted by Joost Verburg
+3 instead of +2
Hm. It works now. It didn't the last time I tried +3 for some reason. Guess I can blame it on being Fri. the 13th. 😉 Thanks!