cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Alex_W
Level 6

How to Rollback or uninstall from OnFirstUIAfter event?

Hi All

Project Type: InstallScript MSI
History: I’ve installed SQLExpress & dropped database files.

In the OnFirstUIAfter event I am attaching the database files that were just installed, also I'm adding a database user to the system and granting access rights to that user.

My questions are:
1) Is the OnFirstUIAfter event the best place to do this?
2) If something goes horribly wrong and the user wants to abort and start all over then what's the best way to do this? ( I can’t use Abort() because about doesn’t initiate a rollback in the OnFirstUIAfter event. )
Labels (1)
0 Kudos
3 Replies
Not applicable

OnFirstUiAfter occurs after the execute sequence finishes and cannot be rolled back.

You probably want to pre-install SQL Express and then have your install make the necessary changes using the SQL Scripts view.
0 Kudos
Alex_W
Level 6

Its really more a question of after I install SQLExpress as a prerequisit where is the best place to attach a database and add a database user? Since I have to copy the application and database files to the target PC, what's the first event I can use to try to that database stuff and can I recover from it or abort the whole install if need be.
0 Kudos
Not applicable

My best suggestion is to use the built-in SQL Scripts view, which takes care of all of this during the deferred sequence and provides rollback functionality (http://helpnet.macrovision.com/Robo/BIN/Robo.dll?tpc=/robo/projects/installshield14helplib/SQLServer.htm).

If you want to roll your own, though, you would definitely want to make sure you're running all your custom actions as deferred custom actions. Otherwise, you won't have any rollback support.
0 Kudos