Inno Setup: Directive or parameter "Check" expression error: Invalid symbol '.' found

Inno Setup: Directive or parameter "Check" expression error: Invalid symbol '.' found

在脚本的顶部,我定义了程序依赖项的版本号。

#define ProductTestsVer "4.13.0.128"

然后我在 Check 函数的 Files 部分使用这个标识符。

Source: src\ff\ProductTests.exe; DestDir: {app}; Check: RegCheck('Software\FFNVNTest\ProductTests', {#ProductTestsVer});

然后我尝试在 Run 部分中使用相同的 Check 函数,导致以下错误:

Directive or parameter "Check" expression error: Invalid symbol '.' found.

我假设我要么犯了一个愚蠢的错误,要么你根本不能在 Run 部分中使用标识符,但我高度怀疑是前者。

谢谢。

我不认为你是对的。即使在 [Files] 部分,该语法也不能(也不会)起作用。使用最新的 Inno Setup 5.5.9(Ansi 和 Unicode)进行测试。

如果您检查预处理器输出,您将看到您的语法解析为:

RegCheck('Software\FFNVNTest\ProductTests', 4.13.0.128);

那不是有效的 Pascal Script 代码。你可能想要:

RegCheck('Software\FFNVNTest\ProductTests', '4.13.0.128');

所以你需要使用:

RegCheck('Software\FFNVNTest\ProductTests', '{#ProductTestsVer}');