From the Inno installation documentation :
All BeforeInstall and AfterInstall functions must not have a return value .
In other words, it cannot be function, because it cannot return anything; it is a procedure. (In the examples on the linked page, you can see that they are all declared as procedure, and none of them contain Resultin the code.)
( , BTW. procedure, Boolean, , , . , , Pascal - procedure .)
, , . msstdfmt.dll setup, [Files] onlyifdoesntexist regserver. , .
[Files]
Source: "msstdfmt.dll"; DestDir: "{sys}"; Flags: onlyifdoesntexist regserver