Thanks Bob.  However, we need to allow the user to specify the directory, including the drive.  I can’t use the “CommonAppDataFolder”; at least, not beyond using it as a default path.  Usually, my users will store data on a different drive.  I need to create the data directory and set specific user permissions.  I have figured out how to use the BrowseDlg as shown in the InstallDirDlg.  I have my own DataDirDlg that is spawns the BrowseDlg.  I can also create directories and set permissions.  I just can’t seem to use the directory that the user chooses in my DataDirDlg via the BroweDlg.

 

In other words, I don’t understand what happens when a user dismisses the BrowseDlg.  It looks like _BrowseProperty is set with the new path.  But how does my DataDirDlg map _BrowseProperty to my data path property?  Here’s my DataDirDlg.  Notice the Browse pushbutton.  I suspect here is part of my problem.

<Property Id="WixUI_DataDirDlg_Browse" Value="BrowseDlg" />

<Dialog Id="DataPathDlg" Width="370" Height="270" Title="[ProductName] [Setup]" NoMinimize="yes">

   <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="[ButtonText_Back]">

      <Publish Event="NewDialog" Value="CustomizeDlg">1</Publish>

   </Control>

   <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="[ButtonText_Next]">

      <Publish Event="SpawnWaitDialog" Value="WaitForCostingDlg">CostingComplete = 1</Publish>

      <Publish Event="NewDialog" Value="VerifyReadyDlg">ProductID</Publish>

   </Control>

   <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="[ButtonText_Cancel]">

      <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>

   </Control>

   <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="[BannerBitmap]" />

   <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">

      <Text>Select the path where data should be stored</Text>

   </Control>

   <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />

   <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes">

      <Text>[DlgTitleFont]Data Path</Text>

   </Control>

   <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />

   <Control Id="DataPathLabel" Type="Text" X="45" Y="73" Width="100" Height="15" TabSkip="no" Text="Data Path:" />

   <Control Id="PathEdit" Type="PathEdit" X="90" Y="71" Width="240" Height="18" Property="DataDirPath" Indirect="yes" />

   <Control Id="Browse" Type="PushButton" X="20" Y="120" Width="56" Height="17" Text="[ButtonText_Browse]">

      <Publish Property="_BrowseProperty" Value="[DataDirPath]">1</Publish>

      <Publish Event="SpawnDialog" Value="[WixUI_DataDirDlg_Browse]">1</Publish>

   </Control>

</Dialog>

 

 

__________________________________

Doug Watts

 


From: Bob Arnson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, September 20, 2006 3:34 PM
To: Douglas Watts
Cc: wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] Directory element and Property

 

Douglas Watts wrote:

I use the BrowseDlg from the WiXUI library to get a data directory from the user.  I store the user’s selection in a property.  Now I need to create the directory using this property.  I have tried the following WiX code but when I run the MSI I immediately get this error “Could not access network location CommonAppDataFolder”.

How do I use properties with the Directory element?

Don't use them directly. Let MSI create them for you. You want something like this:

<Directory Id="CommonAppDataFolder"
  <Directory Id="MyCompanyDataDir"
    <Directory Id="MYAPPDATADIR"

Then during the CostFinalize action, MSI will create the public MYAPPDATADIR property. I'd put your component under that directory rather than using explicit CreateFolder/RemoveFolder; let MSI manage the directories. And you can expose that component as a feature and let the user choose the directory via the normal feature-selection dialog.



-- 
sig://boB
http://bobs.org




-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to