Archive: Windows version from registry


ok, one question about the registry:

I wanna read this string from Nsis:


ReadRegStr $R6 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" "ProductName"


It suppose to read the name of the Windows installed... It works in
my machine Windows ME, because display in the output:
"Microsoft Windows ME".

My question is: does Win95/98 has the same reg path? and What about
NT/2000/XP?

Thanks :p

Use GetWindowsVersion to get the name of the OS:
http://nsis.sourceforge.net/Docs/AppendixB.html#B.5


already try that ;)
but with this you can simplifly the function with 2 or 3 line code.
what you think?


On NT you'll have to use:

ReadRegStr $R6 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "ProductName"


GetWindowsVersion already does that for you, and it was tested on those versions of Windows. You'll have to make sure ProductName is on every Windows version.

Well... it's suppose, isn't?
or less the user tweak the registry ;)
thanks... :up: :p


ReadRegStr $R6 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" "ProductName"

Doesn't work on WinXP

-Stuart


Originally posted by Afrow UK
ReadRegStr $R6 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" "ProductName"

Doesn't work on WinXP

-Stuart
That's way:


ReadRegStr $R6 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "ProductName"
ReadRegStr $R6 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" "ProductName"
;Only one it's going to have the name of Windows in $R6

Afrow, NT usually means NT, 2000 and XP, that's why my post applies to XP too.