If you are talking about an assembly dll then it can be done in a typical .NET way.
As for sample. My always preferred method is a ManagedSetup AfterInstall event, which is btw elevated :
Though Custom Actions may not be the best choice for all cases. Depending on the nature of the failure you custom action may not be called (neither WiX native nor Wix# managed CA). Then you will need to have a process that will monitor the installation and act upon failure. The obvious candidate for this is a bootstrapper, EmbeddeUI or ExternalUI. The samples are included into the distributable package
- If the assembly is distributed then reference it at compile time and implement you routine as required.
-
If the assembly is the global one (GAC) then you can do the same but you don't have to distibute it.
As for sample. My always preferred method is a ManagedSetup AfterInstall event, which is btw elevated :
project.AfterInstall += project_AfterInstall; . . . staticvoid project_AfterInstall(SetupEventArgs e) { //do your stuff here }