在操作系统和架构上自定义设置

时间:2015-05-27 14:16:17

标签: inno-setup pascalscript

我被要求在以下操作系统中运行设置程序:
Windows Vista(仅限x86)及更高版本(x86和x64)

为了限制整个设置在较旧的操作系统中运行,我在[Setup]部分添加了与Windows Vista对应的Minversion=0,6.0.6000

我想知道在Pascal脚本中是否可以应用如下的条件安装:

[Run]

Filename: "{tmp}\mysetup.exe"; Components: Install; MinVersion: 0,6.0.6000; Check: not Iswin64;

Filename: "{tmp}\mysetup.exe"; Components: Install; MinVersion: 0,6.1.7600;

这样mysetup.exe只能在Vista x86和所有更高级别的操作系统上运行。

2 个答案:

答案 0 :(得分:1)

我相信你要找的是BYTE ucXmtdat[60]; ucXmtdat[0] = 0x0A; int timeValue = 290920932; memcpy(ucXmtdat+1, &timeValue, sizeof(int)); int seqNumber = 1; memcpy(ucXmtdat+5, &seqNumber, sizeof(int)); 它是支持参数的所有部分支持的可选参数之一。

可以在此处找到文档:http://www.jrsoftware.org/ishelp/index.php?topic=commonparams&anchor=MinVersion

答案 1 :(得分:1)

使用GetWindowsVersionIsWin64支持功能:

if ((GetWindowsVersion >= $06000000) {Vista} and (not IsWin64)) or
   (GetWindowsVersion >= $06010000) {7} then
begin
  // Install
end;