Display Windows OS Name in a string: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
m (Updated author links.)
m (Adding new author and category links.)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{|align=right
{{PageAuthor|Joel}}
|<small>Author: [[{{ns:2}}:Joel|Joel]] ([[{{ns:3}}:Joel|talk]], [[{{ns:-1}}:Contributions/Joel|contrib]])</small>
 
|}
<br style="clear:both;">
== The Script ==
== The Script ==
<highlight-nsis>
<highlight-nsis>
Line 27: Line 25:
Sectionend
Sectionend
</highlight-nsis>
</highlight-nsis>
[[Category:Other Products Handling Functions]]

Latest revision as of 12:08, 24 June 2005

Author: Joel (talk, contrib)


The Script

; This Function will display the Name of your OS installed.
; Created by Joel
 
Name "Windows OS Name"
OutFile "OSName.exe"
 
Function "GetWIN"
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion" ProductName
StrCmp $0 "" +1 +2
ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" ProductName
FunctionEnd
 
Function .onInit
Call "GetWin"
MessageBox MB_OK|MB_ICONINFORMATION $0
Quit
FunctionEnd
 
Section -Ghost
; Hide Me
Sectionend