Ric*_*chC 6 inno-setup pascalscript
当我编译下面的Inno Setup脚本时,它给了我一个错误(下面).我从这里借了代码,所以我不确定为什么它不能正常工作.
Line 136:
Column 10:
Invalid prototype for 'FileDoesNotExist'
Run Code Online (Sandbox Code Playgroud)
第136行是 function FileDoesNotExist(file: string): Boolean;
[Run]
Filename: "{sys}\regsvr32.exe"; Parameters: "msstdfmt.dll"; WorkingDir: {app}\Pronto\Programs\; BeforeInstall: FileDoesNotExist(ExpandConstant('{sys}\msstdfmt.dll')); StatusMsg: "Registering Controls..."
[Code]
function FileDoesNotExist(file: string): Boolean;
begin
if (FileExists(file)) then
begin
Result := False;
end
else
begin
Result := True;
end;
end;
Run Code Online (Sandbox Code Playgroud)
来自Inno 安装文档:
所有 BeforeInstall 和 AfterInstall 函数都不能有返回值。
换句话说,它不能是 a function,因为它不能返回任何内容;这是一个procedure替代。(您可以从链接页面中的示例中看到它们都被声明为,并且代码中procedure都不包含 a 。)Result
(顺便说一句,您链接的问题也是错误的。它显示 aprocedure的返回类型为Boolean,这当然是不可能的。我怀疑如果它有效,那是因为使用的 Pascal 解析器没有注意到返回值因为procedure声明中的。)
不管怎样,看来你正试图做错事。如果msstdfmt.dll与您的 一起分发setup,您应该将其添加到设置了和标志的[Files]部分。如果它已经安装在用户的系统上,那么它应该已经被注册。onlyifdoesntexistregserver
[Files]
Source: "msstdfmt.dll"; DestDir: "{sys}"; Flags: onlyifdoesntexist regserver
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5732 次 |
| 最近记录: |