Through code, is there is any way to know whether an installation succeeded o开发者_StackOverflow中文版r failed? I need to revert database updates incase the installation failed.
Personally, I think you're doing it backwards. Instead of reverting database updates if the install fails, perform the updates only if the installation succeeds.
Now that the actions are in this order, put the database updates in CurStepChanged
in an
if CurStep=ssDone
block, and they'll only happen after a successful install.
Another option is to perform the updates in the [Run]
section, which happens after everything in [Files]
has been processed (see Installation Order) and after the Cancel button has been disabled.
You can use DeinitializeSetup()
event for monitoring that.
From documentation:
Called just before Setup terminates. Note that this function is called even if the user exits Setup before anything is installed.
More details at Inno Setup Events.
精彩评论