Now on to dialogs.

I have some questions on building a custom dialog. I want to build a dialog that will 
prompt the installer for a user name and password (that will eventually get assigned 
to the service so the service will run under this account). Currently I have:


            <!-- Adds the dialog used to specify the virtual directory name -->
            <dialogs>
                <dialog name="UserCredentialDlg" hcenter="50" vcenter="50"
                    width="360" height="150" attr="39"
                    title="[ProductName] [Manufacturer] [ProductVersion]" 
firstcontrol="UserName"
                    defaultcontrol="UserName" cancelcontrol="Cancel" />
            </dialogs>

            <!-- Adds the controls associated with the dialog -->
            <controls>
                <control dialog="UserCredentialDlg" name="UserLabel" type="Text"
                    x="8" y="8" width="128" height="23" attr="3"
                    text="User:"
                    nextcontrol="UserName" />
                <control dialog="UserCredentialDlg" name="PasswordLabel" type="Text"
                    x="8" y="40" width="128" height="23" attr="3"
                    text="User:"
                    nextcontrol="Password" />
                <control dialog="UserCredentialDlg" name="PasswordConfirmationLabel" 
type="Text"
                    x="8" y="720" width="128" height="23" attr="3"
                    text="User:"
                    nextcontrol="PasswordConfirmation" />
                <control dialog="UserCredentialDlg" name="UserName" type="Edit"
                    x="136" y="8" width="216" height="20" attr="7"
                    property="USERNAME"
                    text="[USERNAME]"
                    nextcontrol="Password" />
                <control dialog="WebFolderDlg" name="Password" type="Edit"
                    x="136" y="40" width="216" height="20" attr="7"
                    property="PASSWORD"
                    text="[PASSWORD]"
                    nextcontrol="PasswordConfirmation" />
                <control dialog="WebFolderDlg" name="PasswordConfirmation" type="Edit"
                    x="136" y="72" width="48" height="18" attr="7"
                    property="PASSWORD"
                    text="[PASSWORD]"
                    nextcontrol="OK" />


                <control dialog="UserCredentialDlg" name="OK" type="PushButton"
                    x="16" y="112" width="56" height="17" attr="3"
                    text="OK" nextcontrol="Cancel" />
                <control dialog="UserCredentialDlg" name="Cancel" type="PushButton"
                    x="272" y="112" width="56" height="17" attr="3"
                    text="Cancel" nextcontrol="BannerBitmap" />

            </controls>

As I understand it this will assign the value entered int the control to a property. 
Question 1, If the installer clicks on OK how does the dialog quit? It seems to be a 
requirement to have a nexcontrol attribute. How does the dialog know to close out and 
use the values entered if the user clicks OK? What if CANCEL is clicked on? How does 
the dialog know that the values should not be used? In this case since these are 
required for our installation if the installer clicks on CANCEL I would like to abort 
the whole installation. Question 2, I would also like to do some validation of the 
input. If the user entered an incorrect user name and/or password I would like to run 
the dialog again maybe indicating some error or warning. If the password and the 
password confirmation don't match I would also like to issue a warning and give the 
installer a chance to try again. I am not sure how to do this given the examples. 
Maybe I need a tutorial or a pointer to some docs.

Finally, what causes this dialog to appear? When does it appear in the sequence? Like 
I said I would like to have the user and password properties set so that in a custom 
action I can retreive them and set the service properties so that the service will run 
under this account. So I want to make sure that these properties are set prior to the 
custom action and I need to know when to execute the custom action so that it will be 
executed after the services have been installed. Any pointers?

Thank you.

Kevin


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
NAntContrib-Developer mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nantcontrib-developer

Reply via email to