Thanks a lot, Blair!

It works now. It seems the "Order" attribute is important. I also realized that 
you added this line:
<Publish Dialog="MyInstallDirDlg" Control="Next" 
Property="WIXUI_INSTALLDIR_VALID" Value="[WIXUI_INSTALLDIR_VALID]" Order="3"/>


Can you tell me where Richard's blog is?

Thanks again. You saved our project.



________________________________
From: Blair <os...@live.com>
To: General discussion for Windows Installer XML toolset. 
<wix-users@lists.sourceforge.net>
Sent: Tuesday, October 27, 2009 2:14:10 PM
Subject: Re: [WiX-users] How to detect files presence and conditionally show a 
new added dialog page

In Richard's blog post, he details the issue with Windows Installer not
recognizing that WIXUI_INSTALLDIR_VALID has had a value set/changed by the
custom action. You don't get anything happening because WI still thinks
WIXUI_INSTALLDIR_VALID != 1.

<Publish Dialog="MyInstallDirDlg" Control="Back" Event="NewDialog"
Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="MyInstallDirDlg" Control="Next" Event="SetTargetPath"
Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="MyInstallDirDlg" Control="Next" Event="DoAction"
Value="WixUIValidatePath" Order="2">1</Publish>
<Publish Dialog="MyInstallDirDlg" Control="Next"
Property="WIXUI_INSTALLDIR_VALID" Value="[WIXUI_INSTALLDIR_VALID]"
Order="3"/>
<Publish Dialog="MyInstallDirDlg" Control="Next" Event="SpawnDialog"
Value="InvalidDirDlg"
Order="4"><![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<!--My code start here-->
<Publish Dialog="MyInstallDirDlg" Control="Next"
Property="InstallDirNextDialog" Value="{}" Order="5"/>
<Publish Dialog="MyInstallDirDlg" Control="Next"
Property="InstallDirNextDialog" Value="MyAddedConfirmDlg"
Order="6"><![CDATA[WIXUI_INSTALLDIR_VALID="1" and
NEED_MIGRATE_SETTING="1"]]></Publish>
<Publish Dialog="MyInstallDirDlg" Control="Next"
Property="InstallDirNextDialog" Value="VerifyReadyDlg"
Order="7"><![CDATA[WIXUI_INSTALLDIR_VALID="1" and
NEED_MIGRATE_SETTING<>"1"]]></Publish>
<Publish Dialog="MyInstallDirDlg" Control="Next" Event="NewDialog"
Value="[InstallDirNextDialog]" Order="8">InstallDirNextDialog</Publish>
<!--My code end here-->
<Publish Dialog="MyInstallDirDlg" Control="ChangeFolder"
Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="MyInstallDirDlg" Control="ChangeFolder" Event="SpawnDialog"
Value="BrowseDlg" Order="2">1</Publish>


-----Original Message-----
From: little.forest [mailto:little.for...@ymail.com] 
Sent: Tuesday, October 27, 2009 1:37 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] How to detect files presence and conditionally show
a new added dialog page

I'm having trouble with this "conditionally show a dialog based on a
property".


Now I can conditionally show the dialog. But when I click on the Next or
Back button, there is nothing happened. I'll have to click the button again
to go forward or back. 
I took the code from WixUI_InstallDir.wxs and renamed it as
MyWixUI_InstallDir.wxs and used it in my project. I changed the code by
using your example, here is my code:
<Publish Dialog="MyInstallDirDlg" Control="Back" Event="NewDialog"
Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="MyInstallDirDlg" Control="Next" Event="SetTargetPath"
Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="MyInstallDirDlg" Control="Next" Event="DoAction"
Value="WixUIValidatePath" Order="2">1</Publish>
<Publish Dialog="MyInstallDirDlg" Control="Next" Event="SpawnDialog"
Value="InvalidDirDlg"
Order="3"><![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<!--My code start here-->
<Publish Dialog="MyInstallDirDlg" Control="Next"
Property="InstallDirNextDialog" Value="{}"/>
<Publish Dialog="MyInstallDirDlg" Control="Next"
Property="InstallDirNextDialog"
Value="MyAddedConfirmDlg"><![CDATA[WIXUI_INSTALLDIR_VALID="1" and
NEED_MIGRATE_SETTING="1"]]></Publish>
<Publish Dialog="MyInstallDirDlg" Control="Next"
Property="InstallDirNextDialog"
Value="VerifyReadyDlg"><![CDATA[WIXUI_INSTALLDIR_VALID="1" and
NEED_MIGRATE_SETTING<>"1"]]></Publish>
<Publish Dialog="MyInstallDirDlg" Control="Next" Event="NewDialog"
Value="[InstallDirNextDialog]" Order="4">InstallDirNextDialog</Publish>
<!--My code end here-->
<Publish Dialog="MyInstallDirDlg" Control="ChangeFolder"
Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="MyInstallDirDlg" Control="ChangeFolder" Event="SpawnDialog"
Value="BrowseDlg" Order="2">1</Publish>


Many thanks.
I'm looking forward your kindly help.



________________________________
From: little.forest <little.for...@ymail.com>
To: General discussion for Windows Installer XML toolset.
<wix-users@lists.sourceforge.net>
Sent: Tuesday, October 27, 2009 12:41:24 AM
Subject: Re: [WiX-users] How to detect files presence and conditionally show
a new added dialog page

Hi Richard,


You're right. I did got some weird error by not using your approach for
button control event when I went back and forth among those dialog pages. 

So I tried your approach, the errors were gone. However, I'm getting some
other new weird issues: every time I've to click the "Next" button or "Back"
button 2 times to go next or go back, very strange. But after this two times
of clicking, I can go back and forth without problem. What's wrong?

You know, I took the code from WixUI_InstallDir.wxs and renamed it as
MyWixUI_InstallDir.wxs and used it in my project. I changed the code by
using your example, here is my code:
<Publish Dialog="MyInstallDirDlg" Control="Back" Event="NewDialog"
Value="LicenseAgreementDlg">1</Publish>
<Publish Dialog="MyInstallDirDlg" Control="Next" Event="SetTargetPath"
Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="MyInstallDirDlg" Control="Next" Event="DoAction"
Value="WixUIValidatePath" Order="2">1</Publish>
<Publish Dialog="MyInstallDirDlg" Control="Next" Event="SpawnDialog"
Value="InvalidDirDlg"
Order="3"><![CDATA[WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
<!--My code start here-->
<Publish Dialog="MyInstallDirDlg" Control="Next"
Property="InstallDirNextDialog" Value="{}"/>
<Publish Dialog="MyInstallDirDlg" Control="Next"
Property="InstallDirNextDialog"
Value="MyAddedConfirmDlg"><![CDATA[WIXUI_INSTALLDIR_VALID="1" and
NEED_MIGRATE_SETTING="1"]]></Publish>
<Publish Dialog="MyInstallDirDlg" Control="Next"
Property="InstallDirNextDialog"
Value="VerifyReadyDlg"><![CDATA[WIXUI_INSTALLDIR_VALID="1" and
NEED_MIGRATE_SETTING<>"1"]]></Publish>
<Publish Dialog="MyInstallDirDlg" Control="Next" Event="NewDialog"
Value="[InstallDirNextDialog]" Order="4">InstallDirNextDialog</Publish>
<!--My code end here-->
<Publish Dialog="MyInstallDirDlg" Control="ChangeFolder"
Property="_BrowseProperty" Value="[WIXUI_INSTALLDIR]" Order="1">1</Publish>
<Publish Dialog="MyInstallDirDlg" Control="ChangeFolder" Event="SpawnDialog"
Value="BrowseDlg" Order="2">1</Publish>


As you can see, I changed the "NewDialog"(Next button) from one line to be 4
lines of code. Is it correct? But I don't know how come I have to click the
next button 2 times to go to the next page? Do I have to write all of those
4 conditions(Not A and Not B, A and B, Not A and B, A and Not B) as 4
publish elements? In my case, I only care about two cases(A and B, A and Not
B), is it okay?

Thanks.
/Brian




________________________________
From: Richard <legal...@xmission.com>
To: wix-users@lists.sourceforge.net
Sent: Wednesday, October 21, 2009 9:01:14 PM
Subject: Re: [WiX-users] How to detect files presence and conditionally show
a new added dialog page


In article <664797.8163...@web59804.mail.ac4.yahoo.com>,
    "little.forest" <little.for...@ymail.com>  writes:

> "Additionally, you can't have more than one NewDialog control event
> on a button, even if the conditions are mutually exclusive." - this is
> interesting. Ca n you tell me where this fact comes from?

Found it.

Its in the docs for the ControlEvent table.

<http://msdn.microsoft.com/en-us/library/aa368037(VS.85).aspx>

    "The exception is that each control can publish a most one
    NewDialog or one SpawnDialog event."
-- 
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>

      Legalize Adulthood! <http://legalizeadulthood.wordpress.com>

----------------------------------------------------------------------------
--
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



      __________________________________________________________________
Connect with friends from any web browser - no download required. Try the
new Yahoo! Canada Messenger for the Web BETA at
http://ca.messenger.yahoo.com/webmessengerpromo.php
----------------------------------------------------------------------------
--
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



      __________________________________________________________________
The new Internet ExplorerR 8 - Faster, safer, easier.  Optimized for Yahoo!
Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/
----------------------------------------------------------------------------
--
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



      __________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your 
favourite sites. Download it now
http://ca.toolbar.yahoo.com.
------------------------------------------------------------------------------
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

Reply via email to