Thanks Bob and Richard.
> Date: Fri, 12 Dec 2008 12:10:40 -0700
> From: Richard <[email protected]>
> Subject: Re: [WiX-users] CA called from DoAction
>
>> In article <[email protected]>,
>> Bob Arnson <[email protected]> writes:
>> Dale Quigg wrote:
>>> I have a custom dialog and when I press "Next", I want a custom
>>> action to fire to check a value in an edit box. If the CA
>>> detects an error, I want it to display a dialog (which does
>>> not work apparently due to the communication issue with
>>> MsiProcessMessage) and then set "something" (which also
>>> apparently does not work) so the original dialog is
>>> re-displayed (not moving to the next dialog).
>>
>> Set a property and use it in a condition for a SpawnDialog control
>> event; returning from that just stays in the "current" dialog.
>
> Yep, you'll want to make sure that your NextDialog control event
> uses this property as well so that when the error dialog is
> spawned, the NextDialog control event doesn't fire.
Thanks to your help, I'm almost there.
I've set up my custom dialog with the Next button defined as;
<Control Id="Next1" Type="PushButton" (snip) Text="&Next1" >
<Publish Event="DoAction" Value="MG_CA_VerifyBothDir"></Publish>
</Control>
Then, I have my dialog publishing either go to the next dialog in the UI or the
"DirNotExist" dialog that I created based on properties.
<Publish Dialog="MG_Cat_DataExportDir" Control="Next1" Value="DirNotExist"
Order="2" Event="NewDialog"> (DATAEXPORTDIR_CHECK OR
DATALOADERDIR_CHECK)</Publish>
<Publish Dialog="MG_Cat_DataExportDir" Control="Next1"
Value="MG_CoreServerDlg" Order="1" Event="NewDialog">NOT (DATAEXPORTDIR_CHECK
OR DATALOADERDIR_CHECK)</Publish>
My problem is that the error dialog is never displayed on the _first_ time
through. Here's the log;
Action 11:13:06: MG_Cat_DataExportDir. Dialog created
(snip)
MSI (c) (7C:84) [11:13:09:743]: PROPERTY CHANGE: Adding DATAEXPORTDIR property.
Its value is 'c:\abc'.
MSI (c) (7C:84) [11:13:14:618]: PROPERTY CHANGE: Adding DATALOADERDIR property.
Its value is 'c:\123'.
MSI (c) (7C:84) [11:13:14:743]: Doing action: MG_CA_VerifyBothDir
Action 11:13:14: MG_CA_VerifyBothDir.
Action start 11:13:14: MG_CA_VerifyBothDir.
MSI (c) (7C:5C) [11:13:14:758]: Invoking remote custom action. DLL:
C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\MSI11D.tmp, Entrypoint: VerifyBothDir
MSI (c) (7C!50) [11:13:14:915]: PROPERTY CHANGE: Adding DATALOADERDIR_CHECK
property. Its value is 'Error - Data Loader directory does not exist: c:\123.'.
MSI (c) (7C!50) [11:13:14:915]: PROPERTY CHANGE: Adding DATAEXPORTDIR_CHECK
property. Its value is 'Error - Data Export directory does not exist: c:\abc.'.
Action ended 11:13:15: MG_CA_VerifyBothDir. Return value 1.
Action 11:13:15: MG_CoreServerDlg. Dialog created
So, you can see that the next dialog, "MG_CoreServerDlg", was displayed even
though it seems the conditions previously defined would have prevented this.
I tried to put the custom action prior to the SpawnDialog like this;
<Control Id="Next1" Type="PushButton" (snip) Text="&Next1" >
<Publish Event="DoAction" Value="MG_CA_VerifyBothDir" Order="2">1</Publish>
<Publish Event="SpawnDialog" Value="DirNotExist"
Order="1">DATAEXPORTDIR_CHECK OR DATALOADERDIR_CHECK</Publish>
</Control>
But this didn't seem to work either.
My problem is that I have a "lag" where the property is being set, but the Next
button doesn't recognize it until the dialog is reinitiated.
I'd appreciate help on getting this working properly.
Thanks,
Dale
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users