Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perform Windows version checking correctly

Status
Not open for further replies.

vanishboy

Programmer
May 5, 2004
7
BE
How can you make sure that your application verifies that the operating system meets the minimum version requirements for the application? (while installing)
 
I use the following code that I picked up along the way:

Public Function GetOSVersion() As String
Select Case Environment.OSVersion.Platform
Case PlatformID.Win32S
Return "Windows 3.1"
Case PlatformID.Win32Windows
Select Case Environment.OSVersion.Version.Minor
Case 0
Return "Windows 95"
Case 10
Return "Windows 98"
Case 90
Return "Windows/ME"
Case Else
Return "Unknown"
End Select
Case PlatformID.Win32NT
Select Case Environment.OSVersion.Version.Major
Case 3
Return "Windows NT 3.51"
Case 4
Return "Windows NT 4.0"
Case 5
Select Case _
Environment.OSVersion.Version.Minor
Case 0
Return "Windows 2000"
Case 1
Return "Winowes XP"
Case 2
Return "Windows 2003"
End Select
Case Else
Return "Unknown"
End Select
Case PlatformID.WinCE
Return "Windows CE"
End Select
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top