Classification: Public
1. Have a MSI property set up that is empty If the custom action has an error 
populate the MSI property Display the error via a custom error dialog if the 
property is not empty?

2. Display the custom action error message in the Custom Action itself (as long 
as the MSI is not running silently)
i.e.: 
[CustomAction]
Public static ActionResult BackupMyDatabase(Session session) {
  Try
  {
    If (session == null}
    {
      Throw new ArgumentNullException("session");
    }
    
    // code to backup db
    
  }
  catch (Exception ex)
  {
    if (session != null)
    {
      session.Log("BackupMyDatabase failed: ");
      if (ex != null)
      {
        session.Log("Exception:");
        session.Log(ex.Message);
      }
      
      session.Message(
                InstallMessage.User + (int)MessageBoxIcon.Error
                + (int)MessageBoxButtons.OK,
                new Record { FormatString = "Setup could not back up the 
database: \nException: " + ex.Message });
    }
    
    return ActionResult.Failure;
  }
   
   if (session != null)
   {
     Session.Log("BackupMyDatabase succeeded...");
   }
   
   return ActionResult.Success;
}

-----Original Message-----
From: Soren Dreijer [mailto:dreijer+l...@echobit.net]
Sent: May-09-14 2:48 PM
To: General discussion for Windows Installer XML toolset.
Subject: [WiX-users] Displaying custom error messages if deferred CA fails

Hi all,

I've Googled and searched the WiX mailing list, but I haven't been able to 
figure this one out yet.

One of the biggest problems I've always had with MSIs is that they rarely 
return useful error messages. I'm using a custom bootstrapper and I'd like to 
display a custom error message if one of my deferred CA's fail.

Since deferred CA's are pretty limited, I don't know how to pass an error value 
or message back to the installer from the CA that I can then use to display the 
proper error UI.

What's the suggested approach? (I hope there's something better than setting a 
registry value.)

Cheers,
Soren
------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity • Requirements for 
releasing software faster • Expert tips and advice for migrating your SCM 
now http://p.sf.net/sfu/perforce _______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

 
This message has been marked as Public by Steven Ogilvie on May-09-14 3:27:03 
PM.

The above classification labels were added to the message by TITUS Message 
Classification. 
For more information visit www.titus.com.

------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to