当我编译下面的代码时,它没有错误地完成,但是当我尝试运行安装文件时,我得到一个类型不匹配的错误。谁能告诉我可能是什么原因造成的?(确切的错误消息是“运行时错误(在 1:66):类型不匹配。”)
[Setup]
DefaultDirName={code:AppDir}\MyApp
[Code]
function AppDir(Param: String): String;
var
Check: Integer;
begin
Check := GetWindowsVersion();
if Check = 6.0 then
Result := ExpandConstant('{userdocs}')
else
Result := ExpandConstant('{pf}');
end;