Posted: 25 Feb 03 (Edited 4 Dec 07) This is a revised version of the previous code I was displaying here, but now includes Windows Vista detection. Most of the credit should go to Brian Long (of The Delphi Magazine) who wrote a short article regarding Windows Versions (source at the bottom of the page). This revised FAQ replaces the GetVersionEx API call with the Delphi RTL global variables: Win32Platform, Win32MajorVersion, Win32MinorVersion, Win32BuildNumber and Win32CSDVersion (all of which can be found in the SysUtils unit of Delphi).
If you want to see how these variables are assigned then go to the InitPlatformId procedure of SysUtils. It now identifies Windows 95 OSR2 and Windows 98 SE as well as Service Pack information for the NT family of Operating Systems. I have included some information about Win32CSDVersion as a comment in the code.
. Introduction There are times when you need to know information about the version of Windows your program is running on. For example:. when reporting bugs;. when wishing to take different actions on different operating systems. The Windows API provides some version information that is common to all 32 bit Windows operating systems. Delphi's run time library (RTL) makes access to this information very straightforward.
We will begin our exploration by seeing how to get the information from the Windows API. Next we will look at Delphi's RTL support and begin the development of a static class that uses this information to provide easy access to OS information. Having reviewed the basic information we will then examine additional information provided by the operating system on later Windows NT OSs. We will use this information to enhance Delphi's RTL support for NT and to extend our static class. Since the additional information we get from Windows is only available on later NT OSs, we will see how to get similar information for early NT OSs by accessing the registry.
Windows 7
We will enhance our static class to be able to utilise the the information from the registry. The last enhancement of our static class will be made when we look at how to detect further information about Windows XP. In particular we will find out how to detect Windows Media Center and Tablet editions and how to learn if a program is running on 64 bit Windows. Our exploration begins in the where we discuss the basic information about the OS that is available on all Windows systems.
On XE2 a new class was introduced to deal with this:. Read TOSVersion.Architecture to check for 32 or 64 bit OS. Read TOSVersion.Platform to check for Windows or Mac. Read TOSVersion.Major and TOSVersion.Minor for version numbers. Read TOSVersion.Name to obtain the basic product name, e.g. Read TOSVersion.ToString to obtain the full product name with version, e.g.
Most users will only need to copy D2Music.mpq from the Diablo 2 Play CD and/or D2xMusic.mpq from the Lord of Destruction CD. For users that originally performed a 'Full Installation' and wish to run without the CD, all '.MPQ' files should be copied from the Diablo 2 CDs to the Diablo 2 directory. Diablo 2 lord of destruction patch.
There are multiple answers here, depending on what you want (this answer is valid in bash and zsh shells, others may vary). Dos run program in background.
![]() ![]() Give More Feedback
Windows 7 Service Pack 1 (Version 6.1, Build 7601, 64-bit Edition). For older versions of Delphi I recommend the following: In order to check for 2000, XP, Vista, 7 I suggest you read and. major.minor = 5.0 = Windows 2000. major.minor = 5.1 = Windows XP. major.minor = 5.2 = Windows 2003 server or XP64. major.minor = 6.0 = Windows Vista/2008 server.
major.minor = 6.1 = Windows 7/2008 server R2 The same information is available on, but the above came from my head! If you are wanting very detailed product information then that takes a bit more work. Warren's answer gives one good route to obtaining that information.
If you are wanting to test capability then version numbers are fine. Use to check if the prevailing OS exceeds a certain version level.
![]()
Although you should check that the function works correctly in your Delphi since the implementation of that function in Delphi 6 and earlier was incorrect. To find out what the native OS architecture is (32 or 64 bit), use the function. This function is not available on older operating systems so you should load it explicitly with GetProcAddress. Test for wProcessorArchitecture=PROCESSORARCHITECTUREAMD64 to check for 64 bit OS. The JEDI JCL already does this, even on versions older than XE2. See David's answer for the built-in solution in XE2 and later. Using the Jedi JCL, you can add unit JclSysInfo, and call function GetWindowsVersion.
It returns an enumerated type TWindowsVersion. Currently JCL contains all shipped windows versions, and gets changed each time Microsoft ships a new version of Windows in a box: TWindowsVersion = (wvUnknown, wvWin95, wvWin95OSR2, wvWin98, wvWin98SE, wvWinME, wvWinNT31, wvWinNT35, wvWinNT351, wvWinNT4, wvWin2000, wvWinXP, wvWin2003, wvWinXP64, wvWin2003R2, wvWinVista, wvWinServer2008, wvWin7, wvWinServer2008R2); If you want to know if you're running 64-bit windows 7 instead of 32-bit, then call JclSysInfo.IsWindows64. Note that JCL allso handles Editions, like Pro, Ultimate, etc.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |