From the Inno Setup documentation:
All BeforeInstall and AfterInstall functions must not have a return value.
In other words, it can't be a function
, because it can't return anything; it's a procedure
instead. (You can see from the examples in the linked page that they're all declared as procedure
, and none of them contains a Result
in the code.)
(The question you linked is also wrong, BTW. It shows a procedure
that has a return type of Boolean
, which of course isn't possible. I'm suspecting that if it worked it's because the Pascal parser used didn't notice the return value because of the procedure
in the declaration.)
It appears you're trying to do it wrong, anyway. If msstdfmt.dll
is being distributed with your setup
, you should be adding it to the [Files]
section with the onlyifdoesntexist
and regserver
flags set. If it's already installed on the user's system, it should already be registered.
[Files]
Source: "msstdfmt.dll"; DestDir: "{sys}"; Flags: onlyifdoesntexist regserver