Managed code custom actions called frequently like that are going to be slow because of all the process creation-and-termination/CLI-state setup-and-teardown/etc. going on. You may be interested in the "workaround" described on this page (http://legalizeadulthood.wordpress.com/2009/10/23/ui-custom-action-guidelin es/) to get properties reevaluated while processing events.
-----Original Message----- From: kerbe...@noopy.org [mailto:kerbe...@noopy.org] Sent: Thursday, October 22, 2009 10:30 AM To: General discussion for Windows Installer XML toolset. Subject: [WiX-users] UserRegistrationDlg dialog and disable Next button until license key of X characters is entered? Hello, I'd like my user registration dialog to work like the license page -- where the Next button is enabled upon clicking the button to agree to the license. I'm working along with the tutorial at http://www.tramontana.co.hu/wix/ and have added a UserRegistrationDlg dialog to the installer UI like so: <Dialog Id="UserRegistrationDlg" Width="400" Height="270" Title="[ProductName] [Setup]" NoMinimize="yes"> <Control Id="NameLabel" Type="Text" X="5" Y="73" Width="100" Height="15" TabSkip="no" Text="&User Name:" /> <Control Id="NameEdit" Type="Edit" X="5" Y="85" Width="220" Height="18" Property="USERNAME" Text="{80}" /> <Control Id="OrganizationLabel" Type="Text" X="5" Y="110" Width="100" Height="15" TabSkip="no" Text="&Organization:" /> <Control Id="OrganizationEdit" Type="Edit" X="5" Y="122" Width="220" Height="18" Property="COMPANYNAME" Text="{80}" /> <Control Id="CDKeyLabel" Type="Text" X="5" Y="147" Width="50" Height="10" TabSkip="no"> <Text>CD &Key:</Text> </Control> <Control Id="CDKeyEdit" Type="Edit" X="5" Y="160" Width="400" Height="16" Property="PIDKEY"/> <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&Back"> <Publish Event="NewDialog" Value="LicenseAgreementDlg">1</Publish> </Control> <!-- Custom behaviors of Next button. --> <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="&Next"> <Condition Action="disable">PIDKEYVALUE = "0"</Condition> <Condition Action="enable">PIDKEYVALUE = "1"</Condition> <Publish Event="ValidateProductID" Value="0">1</Publish> <Publish Event="DoAction" Value="CheckingKey">1</Publish> <Publish Event="DoAction" Value="CheckingPID">1</Publish> <Publish Event="SpawnDialog" Value="InvalidPidDlg">PIDACCEPTED = "0"</Publish> <Publish Event="NewDialog" Value="SetupTypeDlg">ProductID AND PIDACCEPTED AND LicenseAccepted= "1"</Publish> <Publish Event="NewDialog" Value="UserRegistrationDlg">PIDKEYVALUE = "1"</Publish> </Control> <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel"> <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish> </Control> <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="400" Height="44" TabSkip="no" Text="WixUI_Bmp_Banner" /> <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes"> <Text>Please enter your customer information</Text> </Control> <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" /> <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes"> <Text>{\WixUI_Font_Title}Customer Information</Text> </Control> <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" /> </Dialog> Originally I'd thought that I could setup a couple of conditions to enable/disable the Next button depending on the state of text in CDKeyEntry but these don't change state automatically when PIDKEY <> "" -- the Next button ALWAYS remains disabled: <Condition Action="disable">PIDKEY = ""</Condition> <Condition Action="enable">PIDKEY <> "1"</Condition> Since that didn't work I figured that I needed tie an action to a value that I set in a CheckKEY(...) function in a DLL (C#): [CustomAction] public static ActionResult CheckKEY(Session session) { try { string Pid = session["PIDKEY"]; session.Log("*** In CheckKEY: " + Pid + "|" + Pid.Length + "|" + session["PIDKEYVALUE"]); session["PIDKEYVALUE"] = (Pid.Length >= 5) ? "1" : "0"; } catch (Exception E) { session.Log("!!! fux0red: " + E.Message); return ActionResult.Failure; } return ActionResult.Success; } And add this as a custom action to CDKeyEntry: <Control Id="CDKeyEdit" Type="Edit" X="5" Y="160" Width="400" Height="16" Property="PIDKEY"/> <Publish Event="DoAction" Value="CheckingKey">1</Publish> </Control> And add the following event for the Next button: <!-- Custom behaviors of Next button. --> <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="&Next"> ... etc ... <Publish Event="NewDialog" Value="UserRegistrationDlg">PIDKEYVALUE = "1"</Publish> </Control> But even here, not only is the installer VERY SLOW as the result of this lookup, the Next button is never enabled as I'd hope. I've traced the output of the installer and it's clear that CheckKEY(...) is being called AND PIDKEYVALUE is changed from 0 to 1, but I remain unclear as to what might be amiss here. Could someone shed some light? -- K ---------------------------------------------------------------------------- -- Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ WiX-users mailing list WiX-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wix-users