在Inno Setup中确定Windows版本 [英] Determine Windows version in Inno Setup

查看:133
本文介绍了在Inno Setup中确定Windows版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Inno Setup更改操作系统中的回收站.对于用户运行的是Windows 7还是Windows XP,我需要进行一些说明.我尝试使用:

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 FileExists(winDir + '\System32\imageres.dll') then
  if not FileExists(winDir + '\System32\shell32.dll') then
    installError(3);

但是,即使我已经确认它们存在,它似乎也找不到imageres.dllshell32.dll.我究竟做错了什么?还是可以用其他方式检查Windows版本?

But it seems like it can't find imageres.dll or shell32.dll even though I've verified they exist. What am I doing wrong? Or can I check the Windows version another way?

推荐答案

您应使用 函数.它填充 TWindowsVersion 记录:

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.

这篇关于在Inno Setup中确定Windows版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆