You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Besides the installation folder for my executables, I need to create a folder with auxiliary files, in a user-selected location (if user selects a custom install), or in C:\My Data if user selects a default install. I have a custom dialog allowing the user to select the data folder and store the location in a DATAFLD property, but somehow the value being selected by user is not transmitted, so the directory always is C:\DataFolder. What am I doing wrong? Below I describe how I do things. Many respectful thanks.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Besides the installation folder for my executables, I need to create a folder with auxiliary files, in a user-selected location (if user selects a custom install), or in C:\My Data if user selects a default install. I have a custom dialog allowing the user to select the data folder and store the location in a DATAFLD property, but somehow the value being selected by user is not transmitted, so the directory always is
C:\DataFolder
. What am I doing wrong? Below I describe how I do things. Many respectful thanks.I have inside my Package element:
<Property Id="DATAFLD" Value="[WindowsVolume]DataFolder" />
<Directory Id="DataFolder"> <Directory Id="DataFolder2" Name="My Dir2 Name" /> </Directory>
and various component files specifying one of the two folders as their Directory.
To provide the dialog making this choice, I create a dialog with:
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Fragment>
<UI>
<Dialog Id="InstallDirDlgData" Width="370" Height="270" Title="!(loc.InstallDirDlg_Title)">
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)" />
<Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg" />
</Control>
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.InstallDirDlgDescription)" />
<Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="Data Folder"
/><Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" />
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />
<Control Id="FolderLabel" Type="Text" X="20" Y="60" Width="290" Height="30" NoPrefix="yes" Text="Set as Data folder:" />
<Control Id="Folder" Type="PathEdit" X="20" Y="100" Width="320" Height="18" Property="DATAFLD" Indirect="yes" />
<Control Id="ChangeFolder" Type="PushButton" X="20" Y="120" Width="56" Height="17" Text="!(loc.InstallDirDlgChange)" />
</Dialog>
</UI>
</Fragment>
</Wix>
and I publish it with:
<Publish Dialog="InstallDirDlgData" Control="Back" Event="NewDialog" Value="InstallDirDlg" />
<Publish Dialog="InstallDirDlgData" Control="Next" Event="SetTargetPath" Value="[DATAFLD]" Order="1" />
<Publish Dialog="InstallDirDlgData" Control="Next" Event="DoAction" Value="WixUIValidatePath_$(sys.BUILDARCHSHORT)" Order="2" Condition="NOT WIXUI_DONTVALIDATEPATH" />
<Publish Dialog="InstallDirDlgData" Control="Next" Event="SpawnDialog" Value="InvalidDirDlg" Order="3" Condition="NOT WIXUI_DONTVALIDATEPATH AND WIXUI_INSTALLDIR_VALID<>"1"" />
<Publish Dialog="InstallDirDlgData" Control="Next" Event="NewDialog" Value="InstallDirDlgProj" Order="4" Condition="WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"" />
<Publish Dialog="InstallDirDlgData" Control="ChangeFolder" Property="_BrowseProperty" Value="[DATAFLD]" Order="1" />
<Publish Dialog="InstallDirDlgData" Control="ChangeFolder" Event="SpawnDialog" Value="BrowseDlg" Order="2" />
Beta Was this translation helpful? Give feedback.
All reactions