I've got some  custom actions that creates some sql server functions and
create an xml config file as one of the last things that happens in an
install.

If an error occurs in the custom action, I need the install to roll
back,  basically to uninstall itself.

The sql server scripts are installed as text files. The custom actions
reads from the text files and then through an
Connection to the database, it executes the script commands.


Here is how it execute the custom actions:

<InstallExecuteSequence>      
      <Custom Action
="CreateSQLServerDatabaseWithImpersonationLoggedInUser"
After="InstallFinalize">Not Installed AND
DATABASEALREADYEXISTS="FALSE"</Custom>      
      <Custom Action ="CreateHTSServiceConfig"
After="InstallFinalize">Not Installed</Custom>
      <Custom Action ="DeleteHTSLogFilesAndCleanupTask"
Before="InstallFinalize" >Installed</Custom>
    </InstallExecuteSequence>


If I run the install with the After="InstallFinalize" , and the custom
action runs into an error I return the ActionResult.Failure.  I get the
wix dialog that says an error has occurred and the system has not been
modified.  
The system does get modified.

If I run the install with the After="InstallFiles" or
Before="InstallFinalize", the custom action runs into an error where the
scripts files have not been installed yet.

I realize I can always place the content of these scripts files into a
string array and do away with the files.

I would still have a problem though If something happened during config
file creation (CreateHTSServiceConfig). I still need the install to roll
itself back after all other files have been installed.   

Am I using the right approach, is there an event I can look for
Before="some event"  and if the custom action returns an error when
creating  the config file, have the install rollback ?

I do I need a new approach ?

Rob



------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to