I'm at the risk that this blog looks like an Inno Setup only tour, but that's not the intention. I'm just doing some scripting with Inno these days, other projects I can't disclose here (yet).
I've updated the PrepareToInstall scripts (original post is here) to version 0.5 and it's available for download here.
(Updated to v0.5.1 because of a minor mishap in the demo script. Thanks Robert.)
The previous posts on this subject are updated to point to this one, so new finders can have the latest release.
The improvement I made is:
+ Added support for local NextButtonClick, NeedsRestart and PrepareToInstall event functions (set a define and add the prefix 'Local' to the local function name)