[wix-users] Need help: Reading values from PathEdit in multiple Dialogs.

Rajashekar Angadi Jayadevappa Rajashekar.AngadiJayadevappa at toshiba-tsip.com
Mon Jul 31 07:08:58 PDT 2017


Hi All,

                I'm new to the WiX Installer. Need help for one of my requirements. Details:

        I need to prompt the user for folder locations in 4 different dialogs, i.e., have 4 dialogs one after the other and each dialog prompting the user to choose a directory to install a particular feature ( or a set of files ). I'm able to achieve 4 dialogs each with "PathEdit" and corresponding "Browse" button, but the issue I'm facing is whenever I change the folder path in any of the dialog, then the folder paths in all the dialogs get changed. I'm unable to tie-up the folder selection of a particular dialog to itself and avoid propagating its value. i.e., if I select "C:\Program Files(x86)\CustomFolder1" in the first dialog using the "Browse" button, then the 2nd dialog will have its "PathEdit" filled with "C:\Program Files(x86)\CustomFolder1" now if I change the value to a different folder in the 2nd dialog, for example change it to "C:\Program Files(x86)\CustomFolder2" and move to either the next dialog or to the previous dialog, the value would be changed to "C:\Program Files(x86)\CustomFolder2", the previous selected value of "C:\Program Files(x86)\CustomFolder1" is lost & the same is applicable to all the dialogs.

I'm customizing the WixUI_FeatureTree as I need the user to choose the components too (this is one of the paths during installation).

        Any help in solving this issue is very much needed. The code changes in Product.wxs, CustomizedFeatureTree.wxs & the custom dialogs.wxs file are as below, please let me know the changes required in the code to successfully retain the folder selection in the dialogs & to read 4 different paths from 4 dialogs.

The product.wxs file:

  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="CUSTOMPATH" Name="CustFolder" />
      </Directory>
    </Directory>
  </Fragment>

    <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id=" CUSTOMPATH1" Name="CustFolder1" />
      </Directory>
    </Directory>
  </Fragment>


  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id=" CUSTOMPATH2" Name="CustFolder2" />
      </Directory>
    </Directory>
  </Fragment>

    <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id=" CUSTOMPATH3" Name="CustFolder3" />
      </Directory>
    </Directory>
  </Fragment>

  <Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLFOLDER" Name="CustFolder4" />
      </Directory>
    </Directory>
  </Fragment>


The CustomizedFeatureTree.wxs file:

    <Publish Dialog="ChooseDialog" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish>
    <Publish Dialog="ChooseDialog" Control="Next" Property="_BrowseProperty" Value="[CUSTOMPATH]" Order="1"></Publish>
    <Publish Dialog="ChooseDialog" Control="Next" Event="NewDialog" Value="CustDialog1" Order="2"></Publish>

    <Publish Dialog="CustDialog1" Control="Browse" Event="SpawnDialog" Value="BrowseDlg" Order="1"></Publish>
    <Publish Dialog="CustDialog1" Control="Browse" Property="CUSTOMPATH" Value="[CUSTOMPATH]" Order="2"></Publish>
    <Publish Dialog="CustDialog1" Control="Back" Event="NewDialog" Value="ChooseDialog">1</Publish>
    <Publish Dialog="CustDialog1" Control="Next" Event="NewDialog" Value="CustDialog2">1</Publish>
    <Publish Dialog="CustDialog1" Control="Next" Property="_BrowseProperty" Value="[CUSTOMPATH1]">1</Publish>

    <Publish Dialog="CustDialog2" Control="Browse" Event="SpawnDialog" Value="BrowseDlg" Order="1"></Publish>
    <Publish Dialog="CustDialog2" Control="Browse" Property="CUSTOMPATH1" Value="[CUSTOMPATH1]" Order="2"></Publish>
    <Publish Dialog="CustDialog2" Control="Back" Event="NewDialog" Value="CustDialog1">1</Publish>
    <Publish Dialog="CustDialog2" Control="Next" Event="NewDialog" Value="CustDialog3">1</Publish>


    <Publish Dialog="CustDialog3" Control="Browse" Event="SpawnDialog" Value="BrowseDlg" Order="1"></Publish>
    <Publish Dialog="CustDialog3" Control="Browse" Property="CUSTOMPATH2" Value="[CUSTOMPATH2]" Order="2"></Publish>
    <Publish Dialog="CustDialog3" Control="Back" Event="NewDialog" Value="CustDialog2">1</Publish>
    <Publish Dialog="CustDialog3" Control="Next" Event="NewDialog" Value="CustDialog4">1</Publish>


    <Publish Dialog="CustDialog4" Control="Browse" Event="SpawnDialog" Value="BrowseDlg" Order="1"></Publish>
    <Publish Dialog="CustDialog4" Control="Browse" Property="CUSTOMPATH3" Value="[CUSTOMPATH3]" Order="2"></Publish>
    <Publish Dialog="CustDialog4" Control="Back" Event="NewDialog" Value="CustDialog3">1</Publish>


The CustDialog1.wxs file:

    <Property Id="CUSTOMPATH" Value="ProgramFilesFolder"/>

    <Control Type="PathEdit" Id="Folder" Width="150" Height="15" X="140" Y="181" Property="CUSTOMPATH" Indirect="yes" />
    <Control Type="PushButton" Id="Browse" Width="56" Height="17" X="305" Y="180" Text="Browse..." >
      <Publish Event="SpawnDialog" Value="BrowseDlg">1</Publish>
    </Control>


The CustDialog2.wxs file:

      <Property Id="CUSTOMPATH1" Value="ProgramFilesFolder" />

        <Control Type="PathEdit" Id="Folder" Width="150" Height="15" X="140" Y="181" Property="CUSTOMPATH1" Indirect="yes" />
        <Control Type="PushButton" Id="Browse" Width="56" Height="17" X="305" Y="180" Text="Browse..." >
          <Publish Event="SpawnDialog" Value="BrowseDlg">1</Publish>
        </Control>

The CustDialog3.wxs file:

        <Property Id="CUSTOMPATH2" Value="ProgramFilesFolder" />

        <Control Type="PathEdit" Id="Folder" Width="150" Height="15" X="140" Y="181" Property="CUSTOMPATH2" Indirect="yes" />
        <Control Type="PushButton" Id="Browse" Width="56" Height="17" X="305" Y="180" Text="Browse..." >
          <Publish Event="SpawnDialog" Value="BrowseDlg">1</Publish>
        </Control>


The CustDialog4.wxs file:

      <Property Id="CUSTOMPATH3" Value="ProgramFilesFolder" />

        <Control Type="PathEdit" Id="Folder" Width="150" Height="15" X="140" Y="181" Property="CUSTOMPATH3" Indirect="yes" />
        <Control Type="PushButton" Id="Browse" Width="56" Height="17" X="305" Y="180" Text="Browse..." >
          <Publish Event="SpawnDialog" Value="BrowseDlg">1</Publish>
        </Control>

Thanks,
Raj.

The information contained in this e-mail message and in any
attachments/annexure/appendices is confidential to the 
recipient and may contain privileged information. 
If you are not the intended recipient, please notify the
sender and delete the message along with any 
attachments/annexure/appendices. You should not disclose,
copy or otherwise use the information contained in the
message or any annexure. Any views expressed in this e-mail 
are those of the individual sender except where the sender 
specifically states them to be the views of 
Toshiba Software India Pvt. Ltd. (TSIP),Bangalore.

Although this transmission and any attachments are believed to be
free of any virus or other defect that might affect any computer 
system into which it is received and opened, it is the responsibility
of the recipient to ensure that it is virus free and no responsibility 
is accepted by Toshiba Embedded Software India Pvt. Ltd, for any loss or
damage arising in any way from its use.


More information about the wix-users mailing list