程序中关于Windows系统版本号判断

  
    majorVersion = versionInfo.dwMajorVersion;
    minorVersion = versionInfo.dwMinorVersion;

    if (majorVersion == 5 && minorVersion < 1 || majorVersion < 5)
    {
        WindowsVersion = WINDOWS_ANCIENT;
    }
    /* Windows XP */
    else if (majorVersion == 5 && minorVersion == 1)
    {
        WindowsVersion = WINDOWS_XP;
    }
    /* Windows Server 2003 */
    else if (majorVersion == 5 && minorVersion == 2)
    {
        WindowsVersion = WINDOWS_SERVER_2003;
    }
    /* Windows Vista, Windows Server 2008 */
    else if (majorVersion == 6 && minorVersion == 0)
    {
        WindowsVersion = WINDOWS_VISTA;
    }
    /* Windows 7, Windows Server 2008 R2 */
    else if (majorVersion == 6 && minorVersion == 1)
    {
        WindowsVersion = WINDOWS_7;
    }
    /* Windows 8 */
    else if (majorVersion == 6 && minorVersion == 2)
    {
        WindowsVersion = WINDOWS_8;
    }
    else if (majorVersion == 6 && minorVersion > 2 || majorVersion > 6)
    {
        WindowsVersion = WINDOWS_NEW;
    }
[Info] Name=INTL Version=1.00.000 DiskSpace=8000 ;DiskSpace requirement in KB [Startup] CmdLine= SuppressWrongOS=Y ScriptDriven=2 ScriptVer=15.0.0.498 DotNetOptionalInstallIfSilent=N OnUpgrade=0 RequireExactLangMatch=0404,0804 RTLLangs=0401,040d Product=SIMATIC CFC PackageName=Setup.msi EnableLangDlg=Y LogResults=N DoMaintenance=N ProductCode={5784DE5F-8F40-45A4-90D3-1E03B387997C} ProductVersion=07.01.0100 LauncherName=setup.exe PackageCode={C53F8AAB-B0E9-4C02-8734-C7E075939022} [MsiVersion] 2.0.2600.0=SupportOS [SupportOSMsi11] ;Supported platforms for MSI 1.1 Win95=1 Win98=1 WinNT4SP3=1 [SupportOSMsi12] ;Supported platforms for MSI 1.2 Win95=1 Win98=1 WinME=1 WinNT4SP3=1 [SupportOS] ;Supported platforms for MSI 2.0 Win95=1 Win98=1 WinME=1 WinNT4SP6=1 Win2K=1 [SupportOSMsi30] ;Supported platforms for MSI 3.0 Win2KSP3=1 WinXP=1 Win2003Server=1 [Win95] MajorVer=4 MinorVer=0 MinorVerMax=1 BuildNo=950 PlatformId=1 [Win98] MajorVer=4 MinorVer=10 MinorVerMax=11 BuildNo=1998 PlatformId=1 [WinME] MajorVer=4 MinorVer=90 MinorVerMax=91 BuildNo=3000 PlatformId=1 [WinNT4SP3] MajorVer=4 MinorVer=0 MinorVerMax=1 BuildNo=1381 PlatformId=2 ServicePack=768 [WinNT4SP6] MajorVer=4 MinorVer=0 MinorVerMax=1 BuildNo=1381 PlatformId=2 ServicePack=1536 [Win2K] MajorVer=5 MinorVer=0 MinorVerMax=1 BuildNo=2195 PlatformId=2 [Win2KSP3] MajorVer=5 MinorVer=0 MinorVerMax=1 BuildNo=2195 PlatformId=2 ServicePack=768 [WinXP] MajorVer=5 MinorVer=1 MinorVerMax=2 BuildNo=2600 PlatformId=2 [Win2003Server] MajorVer=5 MinorVer=2 MinorVerMax=3 BuildNo=2600 PlatformId=2 [0x0409] TITLE=Choose Setup Language DESCRIPTION=Select the language for this installation from the choices below. OK=OK Cancel=Cancel 0x0409=English (United States) 0x0411=Japanese 0x0401=Arabic (Saudi Arabia) 0x042d=Basque 0x0402=Bulgarian 0x0403=Catalan 0x0804=Chinese (PRC) 0x0404=Chinese (Taiwan) 0x041a=Croatian 0x0405=Czech 0x0406=Danish 0x0413=Dutch (Netherlands) 0x040b=Finnish 0x0c0c=French (Canada) 0x040c=French (France) 0x0407=German (Germany) 0x0408=Greek 0x040d=Hebrew 0x040e=Hungarian 0x0421=Indonesian 0x0410=Italian (Italy) 0x0412=Korean 0x0414=Norwegian (Bokmal) 0x0415=Polish 0x0416=Portuguese (Brazil) 0x0816=Portuguese (Portugal) 0x0418=Romanian 0x0419=Russian 0x0c1a=Serbian (Cyrillic) 0x041b=Slovak 0x0424=Slovenian 0x040a=Spanish (Traditional Sort) 0x041d=Swedish 0x041e=Thai 0x041f=Turkish [Languages] count=5 default=409 key0=40a key1=40c key2=410 key3=407 key4=409 [Setup.msi] Type=0 Location=Setup.msi [Setup.bmp] 0=Setup.bmp Type=0
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值