Hi Colm,
In a Setup Project, we can add a new dialog to the setup wizard. We can also get user inputs from added dialogs and pass them to a custom action. But we cannot pass messages from a custom action to an added dialog. If we want to show some information to the user, we can create our own dialog and show it in the custom action. If we do some action at first, but want to show the returned information in the other steps, we can save the information to saved state dictionary and get it again in the other step. This is a code snippet:
[RunInstaller(true)]
public partial class DataBaseInstall : Installer
{
public override void Install(IDictionary stateSaver)
{
base.Install(stateSaver);
//Do something here.
string msg = DoSomeAction();
//Add returned information to paramters dictionary.
//if we do not need to trasfer messages to the next step,
//We can directly show it.
stateSaver.Add("returnedMsg", msg);
}
public override void Commit(IDictionary savedState)
{
base.Commit(savedState);
//Get information and show it.
//We can build a form with complicated user interfaces to show several messages.
//For example, we can add several textboxes, OK and calcel buttons to a form, then call the
//ShowDialog method to show it.
MessageBox.Show(savedState["returnedMsg"].ToString());
}
//Do some custom action, returen some message which need to be shown to users.
private string DoSomeAction()
{
return "success";
}
}
The link below shows how to transfer information from an added dialog to a custom action:
http://msdn.microsoft.com/en-us/library/9cdb5eda.aspx.
Let me know if this does not help.
Aland Li
Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.