Windows Develop Bookmark and Share   
 index > ClickOnce and Setup & Deployment Projects > Windows Installer : Add text to a dialog
 

Windows Installer : Add text to a dialog

Hi all,
I am editing setup project created with Visual Studio 2005. I'd like to add a dialog or edit the "Installation Complete" dialog to recommend the user take some action based on information I have determined in a custom action.
The only installer options seem to be to add stock dialogs such as "View the Readme".
Is their an API I can use to write to a Dialog?
Can I add a new blank Dialog containinga text control with an ID toand write to it perhaps?


Colm
  • Moved byYiChun ChenMSFTFriday, August 28, 2009 9:03 AMDeployment issue (From:Visual Studio Setup and Installation)
  •  
Colm Lohan  Wednesday, August 26, 2009 12:22 PM

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.
Aland Li  Wednesday, September 02, 2009 4:26 AM
Hi Colm,

I am moving this thread from Base "Visual Studio Setup and Installation" forum to the "ClickOnce and Setup & Deployment Projects" forum, since the issue is related to deployment. There are more deployment experts in the "ClickOnce and Setup & Deployment Projects" forum.

Thanks
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
YiChun Chen  Friday, August 28, 2009 9:03 AM

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.
Aland Li  Wednesday, September 02, 2009 4:26 AM
Thanks for the input.
What I was trying to do was to prompt the user with an information dialog based on the checks (for IIS and ASP.NET) performed by the custom actions. I'll try to use the suggestions you have marked as the answer.
Regards
Colm

Colm
Colm Lohan  Wednesday, September 02, 2009 12:26 PM
Hi Colm,

You are welcome. If my reply does not help, please unmark it and let me know the details.

Regards,
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.
Aland Li  Wednesday, September 02, 2009 12:28 PM

You can use google to search for other answers

Custom Search

More Threads

• Building a file with Express Edition?
• "SignFile" task was not given a value for the required parameter "CertificateThumbprint".
• Setup Project for WebService fails to execute sometimes
• Can I Run Custom Actions Synchronously?
• updating application
• ClickOnce: How to add a prerequisite from the command line?
• Problem updating clickonce app
• Source Files after ClickOnce Install
• how to make an exe which is custom action return values to installer?
• Is it possible to make the setup install .NET framework and SQL Express automatically?