[wix-users] Event="SpawnDialog" failes

Phil Wilson phil.wilson at mvps.org
Mon Oct 3 10:00:53 PDT 2016


Properties don't get re-evaluated in some dialog transitions - I've seen
people use a SetProperty custom action that sets the property to its own
value to force the change, the PROPERTY=[PROPERTY] custom action. 

Phil W  

-----Original Message-----
From: wix-users [mailto:wix-users-bounces at lists.wixtoolset.org] On Behalf Of
Ronny Eriksson
Sent: Sunday, October 02, 2016 7:19 AM
To: WiX Toolset Users Mailing List
Subject: [wix-users] Event="SpawnDialog" failes

Hi



I have MSI that i'm working on but i strange behavior from the
"Event="SpawnDialog"" on a Next button.



So what I want to do is this.

I have a dialog where need the user to put in a path that points to a
specific installation.

To be sure that path is correct I check if the path contains a file.

Do to that I have a "PathEdit" control where the path is.

I have the standard Browse dialog change this path but u can also change it
manualy.



Now as far as I can see the Browse dialog works fine and it companies when
the path is not correct based on my CA that checks the path.

But the dialog that has the PathEdit filed will not.

Why... well let do this is steps so you understand the problem.



1.       Put incorrect path in "PathEdit" field.

2.       Click the next button and I get an info dialog (InvalidWPFDirDlg)
saying that if is not a correct path.

3.       Change the "PathEdit" field to a correct path.

4.       Click the next button and I get to the VerifyReadyDlg as suppose to

5.       Untill this step everything is okay, and working as should.

6.       Click the Back button in the VerifyReadyDlg.

7.       Put an incorrect path in the "PathEdit" field.

8.       Click the next button, and not I DON'T get any dialog and end up in
the VerifyReadyDlg.

Why is not the condition on the next button with the event "SpawnDialog"
valuated the second time?

Does "SpawnDialog" only validate once per session



This is the the Wix code for this problem:

      <Publish Dialog="OpitmityPathDlg" Control="Next" Event="SetTargetPath"
Value="[OPT_INSTALLFOLDER]" Order="1">1</Publish>
      <Publish Dialog="OpitmityPathDlg" Control="Next" Event="DoAction"
Value="WixUIValidatePath" Order="2">NOT WIXUI_DONTVALIDATEPATH</Publish>
     <Publish Dialog="OpitmityPathDlg" Control="Next" Event="DoAction"
Value="VerifyOptimityWPFPath" Order="3">1</Publish>
      <Publish Dialog="OpitmityPathDlg" Control="Next" Event="SpawnDialog"
Value="InvalidDirDlg" Order="4"><![CDATA[NOT WIXUI_DONTVALIDATEPATH AND
WIXUI_INSTALLDIR_VALID<>"1"]]></Publish>
      <Publish Dialog="OpitmityPathDlg" Control="Next" Event="SpawnDialog"
Value="InvalidWPFDirDlg" Order="5">OPT_WPFDIR_VALID="0"</Publish>
      <Publish Dialog="OpitmityPathDlg" Control="Next" Event="NewDialog"
Value="VerifyReadyDlg" Order="6">WIXUI_DONTVALIDATEPATH OR
WIXUI_INSTALLDIR_VALID="1"</Publish>

And the Custom Action is set up like this

    <CustomAction Id="VerifyOptimityWPFPath"
                  BinaryKey="WebAppCA"
                  DllEntry="VerifyOptimityWPFPath"
                  Execute="immediate"
                  Return="check"/>
I have checked that the Custom Action acutely sets the Property
"OPT_WPFDIR_VALID" and even if it is "0" I don't get the "InvalidWPFDirDlg"
saying that the path is incorrect when I got to the "VerifyRedayDlg" once.

Do I have to reset anything, if the user get to the "VerifyRedayDlg" and
then goes back to and changes the  to get this to work somehow?
Or how do I set a Control with Type="PathEdit" to ReadOnly so they can't
change it?

I'm using Wix Version 3.10.1.2213

Best Regards
Ronny

____________________________________________________________________
WiX Toolset Users Mailing List provided by FireGiant
http://www.firegiant.com/








More information about the wix-users mailing list