;--------------------------------
; You must define these values

	!define VERSION "0.1"
	!define PATCH  "0"
 
;--------------------------------
;General

	;Name and file
	Name "test"
	OutFile "test-win32.exe"

	;Set compression
	SetCompressor /SOLID lzma
;---------------------------------
;Variables to define
	Var CVERSION
	Var PNAME
	Var CSDVERSION

;-------------------------------
;Call stdout 
Function OpenStdOut
	System::Call 'kernel32::GetStdHandle(i-11)i.r0'
	System::Call 'kernel32::AttachConsole(i-1)'
FunctionEnd

Function CloseStdOut
	System::Call 'kernel32::CloseHandle(i r0)'
	System::Call 'kernel32::FreeConsole()'
FunctionEnd

Function ConStdOut
	exch $1
	push $0
	FileWrite $0 "$1"
	pop $0
	pop $1
FunctionEnd

!macro ConStdOut _text
	push "${_text}$\n"
	call ConStdOut
!macroend

Section
	Call OpenStdOut
	ReadRegStr $CVERSION HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion
	ReadRegStr $PNAME HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" ProductName
	ReadRegStr $CSDVERSION HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CSDVersion
	!insertmacro ConStdOut ""
	!insertmacro ConStdOut "CurrentVersion NT $CVERSION"
	!insertmacro ConStdOut "ProductName $PNAME"
	!insertmacro ConStdOut "CSDVersion $CSDVERSION"
	Call CloseStdOut
SectionEnd
