Determine Windows version in Inno Setup

后端 未结 3 475
谎友^
谎友^ 2020-12-06 03:06

I\'m using Inno Setup to change the recycle bin in the OS. I need to make some cases for if the user is running Windows 7 or Windows XP. I try using:

if not          


        
3条回答
  •  被撕碎了的回忆
    2020-12-06 03:25

    You should use the GetWindowsVersionEx function. It fills a TWindowsVersion record:

    TWindowsVersion = record
      Major: Cardinal;             // Major version number
      Minor: Cardinal;             // Minor version number
      Build: Cardinal;             // Build number
      ServicePackMajor: Cardinal;  // Major version number of service pack
      ServicePackMinor: Cardinal;  // Minor version number of service pack
      NTPlatform: Boolean;         // True if an NT-based platform
      ProductType: Byte;           // Product type (see below)
      SuiteMask: Word;             // Product suites installed (see below)
    end;
    

    There are a lot of other related functions. See below 'System functions' at this page.

提交回复
热议问题