home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 February / Chip_2004-02_cd1.bin / zkuste / konfig / download / msic / Help / Int / MSI_OS.int < prev    next >
Text File  |  2003-08-26  |  12KB  |  268 lines

  1. {*******************************************************}
  2. {                                                       }
  3. {       MiTeC System Information Component              }
  4. {               OS Detection Part                       }
  5. {           version 8.3 for Delphi 5,6,7                }
  6. {                                                       }
  7. {       Copyright ⌐ 1997,2003 Michal Mutl               }
  8. {                                                       }
  9. {*******************************************************}
  10.  
  11. {$INCLUDE MITEC_DEF.INC}
  12.  
  13. unit MSI_OS;
  14.  
  15. interface
  16.  
  17. uses
  18.   SysUtils, Windows, Classes, MiTeC_Routines, MSI_Common;
  19.  
  20. type
  21.   TTimeZone = class(TPersistent)
  22.   private
  23.     FStdBias: integer;
  24.     FDayBias: integer;
  25.     FBias: integer;
  26.     FDisp: string;
  27.     FStd: string;
  28.     FDayStart: TDatetime;
  29.     FStdStart: TDatetime;
  30.     FDay: string;
  31.     FMap: string;
  32.   public
  33.     procedure GetInfo;
  34.     procedure Report(var sl :TStringList; Standalone: Boolean = True); virtual;
  35.     property MapID: string read FMap;
  36.   published
  37.     property DisplayName: string read FDisp {$IFNDEF D6PLUS} write FDisp {$ENDIF} stored False;
  38.     property StandardName: string read FStd {$IFNDEF D6PLUS} write FStd {$ENDIF} stored False;
  39.     property DaylightName: string read FDay {$IFNDEF D6PLUS} write FDay {$ENDIF} stored False;
  40.     property DaylightStart: TDatetime read FDayStart {$IFNDEF D6PLUS} write FDayStart {$ENDIF} stored False;
  41.     property StandardStart: TDatetime read FStdStart {$IFNDEF D6PLUS} write FStdStart {$ENDIF} stored False;
  42.     property Bias: integer read FBias {$IFNDEF D6PLUS} write FBias {$ENDIF} stored False;
  43.     property DaylightBias: integer read FDayBias {$IFNDEF D6PLUS} write FDayBias {$ENDIF} stored False;
  44.     property StandardBias: integer read FStdBias {$IFNDEF D6PLUS} write FStdBias {$ENDIF} stored False;
  45.   end;
  46.  
  47. const
  48.   VER_NT_WORKSTATION       = $0000001;
  49.   VER_NT_DOMAIN_CONTROLLER = $0000002;
  50.   VER_NT_SERVER            = $0000003;
  51.  
  52.   VER_SUITE_SMALLBUSINESS            = $00000001;
  53.   VER_SUITE_ENTERPRISE               = $00000002;
  54.   VER_SUITE_BACKOFFICE               = $00000004;
  55.   VER_SUITE_COMMUNICATIONS           = $00000008;
  56.   VER_SUITE_TERMINAL                 = $00000010;
  57.   VER_SUITE_SMALLBUSINESS_RESTRICTED = $00000020;
  58.   VER_SUITE_EMBEDDEDNT               = $00000040;
  59.   VER_SUITE_DATACENTER               = $00000080;
  60.   VER_SUITE_SINGLEUSERTS             = $00000100;
  61.   VER_SUITE_PERSONAL                 = $00000200;
  62.   VER_SUITE_BLADE                    = $00000400;
  63.   VER_SUITE_EMBEDDED_RESTRICTED      = $00000800;
  64.  
  65.  
  66.  
  67. type
  68.   POSVersionInfoEx = ^TOSVersionInfoEx;
  69.   TOSVersionInfoEx = record
  70.     dwOSVersionInfoSize: DWORD;
  71.     dwMajorVersion: DWORD;
  72.     dwMinorVersion: DWORD;
  73.     dwBuildNumber: DWORD;
  74.     dwPlatformId: DWORD;
  75.     szCSDVersion: array [0..127] of Char;
  76.     wServicePackMajor: Word;
  77.     wServicePackMinor: Word;
  78.     wSuiteMask: Word;
  79.     wProductType: Byte;
  80.     wReserved: Byte;
  81.   end;
  82.  
  83.   TNtProductType = (ptUnknown, ptWorkStation, ptServer, ptAdvancedServer, ptDataCenter, ptWeb);
  84.  
  85.  
  86.   TNTSuite = (suSmallBusiness, suEnterprise, suBackOffice, suCommunications,
  87.               suTerminal, suSmallBusinessRestricted, suEmbeddedNT, suDataCenter,
  88.               suSingleUserTS,suPersonal,suBlade,suEmbeddedRestricted);
  89.   TNTSuites = set of TNTSuite;
  90.  
  91.   TNTSpecific = class(TPersistent)
  92.   private
  93.     FSPMinorVer: Word;
  94.     FSPMajorVer: Word;
  95.     FProduct: TNTProductType;
  96.     FSuites: TNTSuites;
  97.     FHotFixes: string;
  98.   public
  99.     procedure GetInfo;
  100.     procedure Report(var sl: TStringList; Standalone: Boolean = True); virtual;
  101.     procedure GetInstalledSuitesStr(var sl: TStringList);
  102.     function GetProductTypeStr(PT: TNTProductType): string;
  103.   published
  104.     property ProductType: TNTProductType read FProduct {$IFNDEF D6PLUS} write FProduct {$ENDIF} stored False;
  105.     property InstalledSuites: TNTSuites read FSuites {$IFNDEF D6PLUS} write FSuites {$ENDIF} stored False;
  106.     property ServicePackMajorVersion: Word read FSPMajorVer {$IFNDEF D6PLUS} write FSPMajorVer {$ENDIF} stored False;
  107.     property ServicePackMinorVersion: Word read FSPMinorVer {$IFNDEF D6PLUS} write FSPMinorVer {$ENDIF} stored False;
  108.     property HotFixes: string read FHotFixes {$IFNDEF D6PLUS} write FHotFixes {$ENDIF} stored False;
  109.   end;
  110.  
  111.   TInternet = class(TPersistent)
  112.   private
  113.     FBrowser: string;
  114.     FProxy: string;
  115.     FMailClient: string;
  116.     FCType: TConnectionType;
  117.   public
  118.     function GetConnTypeStr(ACType: TConnectionType): string;
  119.     procedure GetInfo;
  120.     procedure Report(var sl :TStringList; Standalone: Boolean = True); virtual;
  121.   published
  122.     property DefaultBrowser: string read FBrowser {$IFNDEF D6PLUS} write FBrowser {$ENDIF} stored False;
  123.     property DefaultMailClient: string read FMailClient {$IFNDEF D6PLUS} write FMailClient {$ENDIF} stored False;
  124.     property ConnectionType: TConnectionType read FCType {$IFNDEF D6PLUS} write FCType {$ENDIF} stored False;
  125.     property ProxyServer: string read FProxy {$IFNDEF D6PLUS} write FProxy {$ENDIF} stored False;
  126.   end;
  127.  
  128.   TMeasureSystem = (Metric, US);
  129.  
  130.   TPositiveCurrencyMode = (Prefix_No_Separation, Suffix_No_Separation,
  131.                            Prefix_One_Char_Separation, Suffix_One_Char_Separation);
  132.  
  133.   TDateOrder = (MDY, DMY, YMD);
  134.  
  135.   TTimeFormat = (H12, H24);
  136.  
  137.   TYearFormat = (TwoDigit, FourDigit);
  138.  
  139. const
  140.   SNegativeCurrencyMode: array[0..9] of string =
  141.                          ('($1.1)',
  142.                           '-$1.1',
  143.                           '$-1.1',
  144.                           '$1.1-',
  145.                           '(1.1$)',
  146.                           '-1.1$',
  147.                           '1.1-$',
  148.                           '1.1$-',
  149.                           '-1.1 $',
  150.                           '-$ 1.1');
  151.  
  152. type
  153.   TLocaleInfo = Class(TPersistent)
  154.   private
  155.    FLang,
  156.    FEngLang,
  157.    FAbbrLang,
  158.    FCountry,
  159.    FFCountry,
  160.    FAbbrCtry,
  161.    FList,
  162.    FDecimal,
  163.    FDigit,
  164.    FCurrency,
  165.    FIntlSymbol,
  166.    FMonDecSep,
  167.    FMonThoSep,
  168.    FCurrdigit,
  169.    FNCurrMode,
  170.    FDate,
  171.    FTime,
  172.    FTimeFormat,
  173.    FShortDate: string;
  174.    FMeasure: TMeasureSystem;
  175.    FPCurrMode: TPositiveCurrencyMode;
  176.    FShortDateOrdr,
  177.    FLongDateOrdr: TDateOrder;
  178.    FTimeFormatSpec: TTimeFormat;
  179.    FYearFormat: TYearFormat;
  180.   public
  181.    procedure GetInfo(LocaleID: DWORD);
  182.    procedure Report(var sl: TStringList; Standalone: Boolean = True); virtual;
  183.   published
  184.    property FullLocalizeLanguage: string read Flang {$IFNDEF D6PLUS} write Flang {$ENDIF} stored false;
  185.    property FullLanguageEnglishName: string read FEngLang {$IFNDEF D6PLUS} write FEngLang {$ENDIF} stored false;
  186.    property AbbreviateLanguageName: string read FAbbrLang {$IFNDEF D6PLUS} write FAbbrLang {$ENDIF} stored false;
  187.    property CountryCode: string read FCountry {$IFNDEF D6PLUS} write FCountry {$ENDIF} stored false;
  188.    property FullCountryCode: string read FFCountry {$IFNDEF D6PLUS} write FFCountry {$ENDIF} stored false;
  189.    property AbbreviateCountryCode: string read FAbbrCtry {$IFNDEF D6PLUS} write FAbbrCtry {$ENDIF} stored false;
  190.    property ListSeparator: string read FList {$IFNDEF D6PLUS} write FList {$ENDIF} stored false;
  191.    property MeasurementSystem: TMeasureSystem read FMeasure {$IFNDEF D6PLUS} write FMeasure {$ENDIF} stored false;
  192.    property DecimalSeparator: string read FDecimal {$IFNDEF D6PLUS} write FDecimal {$ENDIF} stored false;
  193.    property NumberOfDecimalDigits: string read FDigit {$IFNDEF D6PLUS} write FDigit {$ENDIF} stored false;
  194.    property LocalMonetarySymbol: string read FCurrency {$IFNDEF D6PLUS} write FCurrency {$ENDIF} stored false;
  195.    property InternationalMonetarySymbol: string read FIntlSymbol {$IFNDEF D6PLUS} write FIntlSymbol {$ENDIF} stored false;
  196.    Property CurrencyDecimalSeparator: string read FMonDecSep {$IFNDEF D6PLUS} write FMonDecSep {$ENDIF} stored false;
  197.    property CurrencyThousandSeparator: string read FMonThoSep {$IFNDEF D6PLUS} write FMonThoSep {$ENDIF} stored false;
  198.    property CurrencyDecimalDigits: string read FCurrDigit {$IFNDEF D6PLUS} write FCurrDigit {$ENDIF} stored false;
  199.    property PositiveCurrencyMode: TPositiveCurrencyMode read FPCurrMode {$IFNDEF D6PLUS} write FPCurrMode {$ENDIF} stored false;
  200.    property NegativeCurrencyMode: string read FNCurrMode {$IFNDEF D6PLUS} write FNCurrMode {$ENDIF} stored false;
  201.    property DateSeparator: string read FDate {$IFNDEF D6PLUS} write FDate {$ENDIF} stored false;
  202.    property TimeSeparator: string read FTime {$IFNDEF D6PLUS} write FTime {$ENDIF} stored false;
  203.    property TimeFormat: string read FTimeFormat {$IFNDEF D6PLUS} write FTimeFormat {$ENDIF} stored false;
  204.    property ShortDateFormat: string read FShortDate {$IFNDEF D6PLUS} write FShortDate {$ENDIF} stored false;
  205.    property ShortDateOrder: TDateOrder read FShortDateOrdr {$IFNDEF D6PLUS} write FShortDateOrdr {$ENDIF} stored false;
  206.    property LongDateOrder: TDateOrder read FLongDateOrdr {$IFNDEF D6PLUS} write FLongDateOrdr {$ENDIF} stored false;
  207.    property TimeFormatSpecifier: TTimeFormat read FTimeFormatSpec {$IFNDEF D6PLUS} write FTimeFormatSpec {$ENDIF} stored false;
  208.    property YearFormat: TYearFormat read FYearFormat {$IFNDEF D6PLUS} write FYearFormat {$ENDIF} stored false;
  209.   end;
  210.  
  211.   TOSPlatform = (opWin31, opWin9x, opWinNT);
  212.  
  213.   TOperatingSystem = class(TPersistent)
  214.   private
  215.     FBuildNumber: integer;
  216.     FMajorVersion: integer;
  217.     FMinorVersion: integer;
  218.     FPlatform: TOSPlatform;
  219.     FCSD: string;
  220.     FVersion: string;
  221.     FRegUser: string;
  222.     FProductID: string;
  223.     FRegOrg: string;
  224.     FEnv: TStrings;
  225.     FDirs: TStrings;
  226.     FTZ: TTimeZone;
  227.     FNTSpec: TNTSpecific;
  228.     FProductKey: string;
  229.     FDVD: string;
  230.     FInternet: TInternet;
  231.     FMode: TExceptionMode;
  232.     FCSDEx: string;
  233.     FLocale: TLocaleInfo;
  234.     FSysLangDefID: string;
  235.   protected
  236.   public
  237.     constructor Create;
  238.     destructor Destroy; override;
  239.     procedure GetInfo;
  240.     procedure Report(var sl :TStringList; Standalone: Boolean = True); virtual;
  241.     property CSDEx :string read FCSDEx;
  242.   published
  243.     property ExceptionMode: TExceptionMode read FMode write FMode;
  244.     property MajorVersion :integer read FMajorVersion {$IFNDEF D6PLUS} write FMajorVersion {$ENDIF} stored false;
  245.     property MinorVersion :integer read FMinorVersion {$IFNDEF D6PLUS} write FMinorVersion {$ENDIF} stored false;
  246.     property BuildNumber :integer read FBuildNumber {$IFNDEF D6PLUS} write FBuildNumber {$ENDIF} stored false;
  247.     property Platform :TOSPlatform read FPlatform {$IFNDEF D6PLUS} write FPlatform {$ENDIF} stored false;
  248.     property Version :string read FVersion {$IFNDEF D6PLUS} write FVersion {$ENDIF} stored false;
  249.     property CSD :string read FCSD {$IFNDEF D6PLUS} write FCSD {$ENDIF} stored false;
  250.     property ProductID :string read FProductID {$IFNDEF D6PLUS} write FProductID {$ENDIF} stored false;
  251.     property ProductKey :string read FProductKey {$IFNDEF D6PLUS} write FProductKey {$ENDIF} stored False;
  252.     property RegisteredUser :string read FRegUser {$IFNDEF D6PLUS} write FRegUser {$ENDIF} stored false;
  253.     property RegisteredOrg :string read FRegOrg {$IFNDEF D6PLUS} write FRegOrg {$ENDIF} stored false;
  254.     property TimeZone :TTimeZone read FTZ {$IFNDEF D6PLUS} write FTZ {$ENDIF} stored false;
  255.     property Environment :TStrings read FEnv {$IFNDEF D6PLUS} write FEnv {$ENDIF} stored false;
  256.     property Folders: TStrings read FDirs {$IFNDEF D6PLUS} write FDirs {$ENDIF} stored False;
  257.     property NTSpecific: TNTSpecific read FNTSpec {$IFNDEF D6PLUS} write FNTSpec {$ENDIF} stored False;
  258.     property DVDRegion: string read FDVD {$IFNDEF D6PLUS} write FDVD {$ENDIF} stored False;
  259.     property Internet: TInternet read FInternet {$IFNDEF D6PLUS} write FInternet {$ENDIF} stored False;
  260.     property LocaleInfo: TLocaleInfo read FLocale {$IFNDEF D6PLUS} write FLocale {$ENDIF} stored False;
  261.     property LanguageID: string read FSysLangDefID {$IFNDEF D6PLUS} write FSysLangDefID {$ENDIF} stored False;
  262.   end;
  263.  
  264. function GetVersionEx(lpVersionInformation: POSVersionInfoEx): BOOL; stdcall;
  265.  
  266. implementation
  267.  
  268.