在 DirExistsWarning 和其他指令中使用脚本常量

Using scripting constant in DirExistsWarning and other directives

我正在尝试编写常量 DirExistsWarning 脚本,但它 returns 出现错误:

Value of [Setup] section directive "DirExistsWarning" is invalid.

我的简化脚本是这样的:

...
[Setup]
DirExistsWarning={code:showFolderExists}
...
[Code]
{ hide folder exists Dialog when this version is being uninstalled }
function showFolderExists(Param: String): String;
begin
    Result := 'yes';
end;

这个常量不能编写脚本吗?如果是这样,是否有可以或不能编写脚本的可访问常量列表? 我也试过返回一个布尔值,但没有成功。

谢谢

是的,DirExistsWarning directive 无法编写脚本,因为它的值不能包含 "constants"(原文如此)。

可以包含“constants" (what includes "scripted constants”的指令在其文档中明确提及。

例如 AppId directive 的文档说:

The value may include constants.


对于您的实际问题,请参阅 .