OS Detection
- From: "John J. Jobst" <john.j.jobst@xxxxxxxxxxx>
- Date: Wed, 7 Feb 2007 07:22:06 -0600
Any hints for an SMS Installer script to detect which OS is running now that
Vista is here? I have the bits for lots of previous OSs. Thanks.
item: Remark
Text=.
end
item: Remark
Text=Figure out what version of Windows is running.
end
item: Remark
Text=.
end
item: Get System Information
Variable=WINVER
Flags=00000001
end
item: Parse String
Source=%WINVER%
Pattern=.
Variable1=MAJOR
Variable2=MINBLD
end
item: Parse String
Source=%MINBLD%
Pattern=.
Variable1=MINOR
Variable2=BUILDNO
end
item: Check Configuration
Flags=10100000
end
item: Get System Information
Variable=NTSPNUM
Flags=00010010
end
item: If/While Statement
Variable=MAJOR
Value=3
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Windows NT 3.51
end
item: Else Statement
end
item: If/While Statement
Variable=MAJOR
Value=4
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Windows NT 4.0
end
item: Else Statement
end
item: If/While Statement
Variable=MAJOR
Value=5
end
item: If/While Statement
Variable=MINOR
Value=0
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Windows 2000
end
item: Else Statement
end
item: If/While Statement
Variable=MINOR
Value=1
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Windows XP
end
item: Else Statement
end
item: If/While Statement
Variable=MINOR
Value=2
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Windows Server 2003
end
item: Else Statement
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Unknown Windows NT
end
item: End Block
end
item: End Block
end
item: End Block
end
item: End Block
end
item: End Block
end
item: End Block
end
item: Else Statement
end
item: If/While Statement
Variable=MINOR
Value=0
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Windows 95
end
item: Else Statement
end
item: If/While Statement
Variable=MINOR
Value=10
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Windows 98
end
item: Else Statement
end
item: If/While Statement
Variable=MINOR
Value=90
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Windows ME
end
item: Else Statement
end
item: Set Variable
Variable=WINDOWSVERSION
Value=Unknown Windows 9x
end
item: End Block
end
item: End Block
end
item: End Block
end
item: End Block
end
item: Get Registry Key Value
Variable=CSD
Key=SOFTWARE\Microsoft\Windows NT\CurrentVersion
Value Name=CSDVersion
Flags=00000100
end
item: Set Variable
Variable=TYPE
Value=Workstation
end
item: Check Configuration
Flags=10100000
end
item: Get Registry Key Value
Variable=NTTYPE
Key=SYSTEM\CurrentControlSet\Control\ProductOptions
Value Name=ProductType
Flags=00000100
end
item: If/While Statement
Variable=NTTYPE
Value=ServerNT
Flags=00000100
end
item: Set Variable
Variable=TYPE
Value=Server
end
item: Else Statement
end
item: If/While Statement
Variable=NTTYPE
Value=Terminal Server
Flags=00000100
end
item: Set Variable
Variable=TYPE
Value=Server
end
item: Else Statement
end
item: If/While Statement
Variable=NTTYPE
Value=LanmanNT
Flags=00000100
end
item: Set Variable
Variable=TYPE
Value=Server
end
item: End Block
end
item: End Block
end
item: End Block
end
item: End Block
end
.
Relevant Pages
|