home *** CD-ROM | disk | FTP | other *** search
- {*******************************************************}
- { }
- { MiTeC System Information Component }
- { OS Detection Part }
- { version 8.3 for Delphi 5,6,7 }
- { }
- { Copyright ⌐ 1997,2003 Michal Mutl }
- { }
- {*******************************************************}
-
- {$INCLUDE MITEC_DEF.INC}
-
- unit MSI_OS;
-
- interface
-
- uses
- SysUtils, Windows, Classes, MiTeC_Routines, MSI_Common;
-
- type
- TTimeZone = class(TPersistent)
- private
- FStdBias: integer;
- FDayBias: integer;
- FBias: integer;
- FDisp: string;
- FStd: string;
- FDayStart: TDatetime;
- FStdStart: TDatetime;
- FDay: string;
- FMap: string;
- public
- procedure GetInfo;
- procedure Report(var sl :TStringList; Standalone: Boolean = True); virtual;
- property MapID: string read FMap;
- published
- property DisplayName: string read FDisp {$IFNDEF D6PLUS} write FDisp {$ENDIF} stored False;
- property StandardName: string read FStd {$IFNDEF D6PLUS} write FStd {$ENDIF} stored False;
- property DaylightName: string read FDay {$IFNDEF D6PLUS} write FDay {$ENDIF} stored False;
- property DaylightStart: TDatetime read FDayStart {$IFNDEF D6PLUS} write FDayStart {$ENDIF} stored False;
- property StandardStart: TDatetime read FStdStart {$IFNDEF D6PLUS} write FStdStart {$ENDIF} stored False;
- property Bias: integer read FBias {$IFNDEF D6PLUS} write FBias {$ENDIF} stored False;
- property DaylightBias: integer read FDayBias {$IFNDEF D6PLUS} write FDayBias {$ENDIF} stored False;
- property StandardBias: integer read FStdBias {$IFNDEF D6PLUS} write FStdBias {$ENDIF} stored False;
- end;
-
- const
- VER_NT_WORKSTATION = $0000001;
- VER_NT_DOMAIN_CONTROLLER = $0000002;
- VER_NT_SERVER = $0000003;
-
- VER_SUITE_SMALLBUSINESS = $00000001;
- VER_SUITE_ENTERPRISE = $00000002;
- VER_SUITE_BACKOFFICE = $00000004;
- VER_SUITE_COMMUNICATIONS = $00000008;
- VER_SUITE_TERMINAL = $00000010;
- VER_SUITE_SMALLBUSINESS_RESTRICTED = $00000020;
- VER_SUITE_EMBEDDEDNT = $00000040;
- VER_SUITE_DATACENTER = $00000080;
- VER_SUITE_SINGLEUSERTS = $00000100;
- VER_SUITE_PERSONAL = $00000200;
- VER_SUITE_BLADE = $00000400;
- VER_SUITE_EMBEDDED_RESTRICTED = $00000800;
-
-
-
- type
- POSVersionInfoEx = ^TOSVersionInfoEx;
- TOSVersionInfoEx = record
- dwOSVersionInfoSize: DWORD;
- dwMajorVersion: DWORD;
- dwMinorVersion: DWORD;
- dwBuildNumber: DWORD;
- dwPlatformId: DWORD;
- szCSDVersion: array [0..127] of Char;
- wServicePackMajor: Word;
- wServicePackMinor: Word;
- wSuiteMask: Word;
- wProductType: Byte;
- wReserved: Byte;
- end;
-
- TNtProductType = (ptUnknown, ptWorkStation, ptServer, ptAdvancedServer, ptDataCenter, ptWeb);
-
-
- TNTSuite = (suSmallBusiness, suEnterprise, suBackOffice, suCommunications,
- suTerminal, suSmallBusinessRestricted, suEmbeddedNT, suDataCenter,
- suSingleUserTS,suPersonal,suBlade,suEmbeddedRestricted);
- TNTSuites = set of TNTSuite;
-
- TNTSpecific = class(TPersistent)
- private
- FSPMinorVer: Word;
- FSPMajorVer: Word;
- FProduct: TNTProductType;
- FSuites: TNTSuites;
- FHotFixes: string;
- public
- procedure GetInfo;
- procedure Report(var sl: TStringList; Standalone: Boolean = True); virtual;
- procedure GetInstalledSuitesStr(var sl: TStringList);
- function GetProductTypeStr(PT: TNTProductType): string;
- published
- property ProductType: TNTProductType read FProduct {$IFNDEF D6PLUS} write FProduct {$ENDIF} stored False;
- property InstalledSuites: TNTSuites read FSuites {$IFNDEF D6PLUS} write FSuites {$ENDIF} stored False;
- property ServicePackMajorVersion: Word read FSPMajorVer {$IFNDEF D6PLUS} write FSPMajorVer {$ENDIF} stored False;
- property ServicePackMinorVersion: Word read FSPMinorVer {$IFNDEF D6PLUS} write FSPMinorVer {$ENDIF} stored False;
- property HotFixes: string read FHotFixes {$IFNDEF D6PLUS} write FHotFixes {$ENDIF} stored False;
- end;
-
- TInternet = class(TPersistent)
- private
- FBrowser: string;
- FProxy: string;
- FMailClient: string;
- FCType: TConnectionType;
- public
- function GetConnTypeStr(ACType: TConnectionType): string;
- procedure GetInfo;
- procedure Report(var sl :TStringList; Standalone: Boolean = True); virtual;
- published
- property DefaultBrowser: string read FBrowser {$IFNDEF D6PLUS} write FBrowser {$ENDIF} stored False;
- property DefaultMailClient: string read FMailClient {$IFNDEF D6PLUS} write FMailClient {$ENDIF} stored False;
- property ConnectionType: TConnectionType read FCType {$IFNDEF D6PLUS} write FCType {$ENDIF} stored False;
- property ProxyServer: string read FProxy {$IFNDEF D6PLUS} write FProxy {$ENDIF} stored False;
- end;
-
- TMeasureSystem = (Metric, US);
-
- TPositiveCurrencyMode = (Prefix_No_Separation, Suffix_No_Separation,
- Prefix_One_Char_Separation, Suffix_One_Char_Separation);
-
- TDateOrder = (MDY, DMY, YMD);
-
- TTimeFormat = (H12, H24);
-
- TYearFormat = (TwoDigit, FourDigit);
-
- const
- SNegativeCurrencyMode: array[0..9] of string =
- ('($1.1)',
- '-$1.1',
- '$-1.1',
- '$1.1-',
- '(1.1$)',
- '-1.1$',
- '1.1-$',
- '1.1$-',
- '-1.1 $',
- '-$ 1.1');
-
- type
- TLocaleInfo = Class(TPersistent)
- private
- FLang,
- FEngLang,
- FAbbrLang,
- FCountry,
- FFCountry,
- FAbbrCtry,
- FList,
- FDecimal,
- FDigit,
- FCurrency,
- FIntlSymbol,
- FMonDecSep,
- FMonThoSep,
- FCurrdigit,
- FNCurrMode,
- FDate,
- FTime,
- FTimeFormat,
- FShortDate: string;
- FMeasure: TMeasureSystem;
- FPCurrMode: TPositiveCurrencyMode;
- FShortDateOrdr,
- FLongDateOrdr: TDateOrder;
- FTimeFormatSpec: TTimeFormat;
- FYearFormat: TYearFormat;
- public
- procedure GetInfo(LocaleID: DWORD);
- procedure Report(var sl: TStringList; Standalone: Boolean = True); virtual;
- published
- property FullLocalizeLanguage: string read Flang {$IFNDEF D6PLUS} write Flang {$ENDIF} stored false;
- property FullLanguageEnglishName: string read FEngLang {$IFNDEF D6PLUS} write FEngLang {$ENDIF} stored false;
- property AbbreviateLanguageName: string read FAbbrLang {$IFNDEF D6PLUS} write FAbbrLang {$ENDIF} stored false;
- property CountryCode: string read FCountry {$IFNDEF D6PLUS} write FCountry {$ENDIF} stored false;
- property FullCountryCode: string read FFCountry {$IFNDEF D6PLUS} write FFCountry {$ENDIF} stored false;
- property AbbreviateCountryCode: string read FAbbrCtry {$IFNDEF D6PLUS} write FAbbrCtry {$ENDIF} stored false;
- property ListSeparator: string read FList {$IFNDEF D6PLUS} write FList {$ENDIF} stored false;
- property MeasurementSystem: TMeasureSystem read FMeasure {$IFNDEF D6PLUS} write FMeasure {$ENDIF} stored false;
- property DecimalSeparator: string read FDecimal {$IFNDEF D6PLUS} write FDecimal {$ENDIF} stored false;
- property NumberOfDecimalDigits: string read FDigit {$IFNDEF D6PLUS} write FDigit {$ENDIF} stored false;
- property LocalMonetarySymbol: string read FCurrency {$IFNDEF D6PLUS} write FCurrency {$ENDIF} stored false;
- property InternationalMonetarySymbol: string read FIntlSymbol {$IFNDEF D6PLUS} write FIntlSymbol {$ENDIF} stored false;
- Property CurrencyDecimalSeparator: string read FMonDecSep {$IFNDEF D6PLUS} write FMonDecSep {$ENDIF} stored false;
- property CurrencyThousandSeparator: string read FMonThoSep {$IFNDEF D6PLUS} write FMonThoSep {$ENDIF} stored false;
- property CurrencyDecimalDigits: string read FCurrDigit {$IFNDEF D6PLUS} write FCurrDigit {$ENDIF} stored false;
- property PositiveCurrencyMode: TPositiveCurrencyMode read FPCurrMode {$IFNDEF D6PLUS} write FPCurrMode {$ENDIF} stored false;
- property NegativeCurrencyMode: string read FNCurrMode {$IFNDEF D6PLUS} write FNCurrMode {$ENDIF} stored false;
- property DateSeparator: string read FDate {$IFNDEF D6PLUS} write FDate {$ENDIF} stored false;
- property TimeSeparator: string read FTime {$IFNDEF D6PLUS} write FTime {$ENDIF} stored false;
- property TimeFormat: string read FTimeFormat {$IFNDEF D6PLUS} write FTimeFormat {$ENDIF} stored false;
- property ShortDateFormat: string read FShortDate {$IFNDEF D6PLUS} write FShortDate {$ENDIF} stored false;
- property ShortDateOrder: TDateOrder read FShortDateOrdr {$IFNDEF D6PLUS} write FShortDateOrdr {$ENDIF} stored false;
- property LongDateOrder: TDateOrder read FLongDateOrdr {$IFNDEF D6PLUS} write FLongDateOrdr {$ENDIF} stored false;
- property TimeFormatSpecifier: TTimeFormat read FTimeFormatSpec {$IFNDEF D6PLUS} write FTimeFormatSpec {$ENDIF} stored false;
- property YearFormat: TYearFormat read FYearFormat {$IFNDEF D6PLUS} write FYearFormat {$ENDIF} stored false;
- end;
-
- TOSPlatform = (opWin31, opWin9x, opWinNT);
-
- TOperatingSystem = class(TPersistent)
- private
- FBuildNumber: integer;
- FMajorVersion: integer;
- FMinorVersion: integer;
- FPlatform: TOSPlatform;
- FCSD: string;
- FVersion: string;
- FRegUser: string;
- FProductID: string;
- FRegOrg: string;
- FEnv: TStrings;
- FDirs: TStrings;
- FTZ: TTimeZone;
- FNTSpec: TNTSpecific;
- FProductKey: string;
- FDVD: string;
- FInternet: TInternet;
- FMode: TExceptionMode;
- FCSDEx: string;
- FLocale: TLocaleInfo;
- FSysLangDefID: string;
- protected
- public
- constructor Create;
- destructor Destroy; override;
- procedure GetInfo;
- procedure Report(var sl :TStringList; Standalone: Boolean = True); virtual;
- property CSDEx :string read FCSDEx;
- published
- property ExceptionMode: TExceptionMode read FMode write FMode;
- property MajorVersion :integer read FMajorVersion {$IFNDEF D6PLUS} write FMajorVersion {$ENDIF} stored false;
- property MinorVersion :integer read FMinorVersion {$IFNDEF D6PLUS} write FMinorVersion {$ENDIF} stored false;
- property BuildNumber :integer read FBuildNumber {$IFNDEF D6PLUS} write FBuildNumber {$ENDIF} stored false;
- property Platform :TOSPlatform read FPlatform {$IFNDEF D6PLUS} write FPlatform {$ENDIF} stored false;
- property Version :string read FVersion {$IFNDEF D6PLUS} write FVersion {$ENDIF} stored false;
- property CSD :string read FCSD {$IFNDEF D6PLUS} write FCSD {$ENDIF} stored false;
- property ProductID :string read FProductID {$IFNDEF D6PLUS} write FProductID {$ENDIF} stored false;
- property ProductKey :string read FProductKey {$IFNDEF D6PLUS} write FProductKey {$ENDIF} stored False;
- property RegisteredUser :string read FRegUser {$IFNDEF D6PLUS} write FRegUser {$ENDIF} stored false;
- property RegisteredOrg :string read FRegOrg {$IFNDEF D6PLUS} write FRegOrg {$ENDIF} stored false;
- property TimeZone :TTimeZone read FTZ {$IFNDEF D6PLUS} write FTZ {$ENDIF} stored false;
- property Environment :TStrings read FEnv {$IFNDEF D6PLUS} write FEnv {$ENDIF} stored false;
- property Folders: TStrings read FDirs {$IFNDEF D6PLUS} write FDirs {$ENDIF} stored False;
- property NTSpecific: TNTSpecific read FNTSpec {$IFNDEF D6PLUS} write FNTSpec {$ENDIF} stored False;
- property DVDRegion: string read FDVD {$IFNDEF D6PLUS} write FDVD {$ENDIF} stored False;
- property Internet: TInternet read FInternet {$IFNDEF D6PLUS} write FInternet {$ENDIF} stored False;
- property LocaleInfo: TLocaleInfo read FLocale {$IFNDEF D6PLUS} write FLocale {$ENDIF} stored False;
- property LanguageID: string read FSysLangDefID {$IFNDEF D6PLUS} write FSysLangDefID {$ENDIF} stored False;
- end;
-
- function GetVersionEx(lpVersionInformation: POSVersionInfoEx): BOOL; stdcall;
-
- implementation
-
-