BrowseFolder control for non-installation folder

Got a problem you cannot solve? Try here.
IanM
Posts: 42
Joined: Tue Mar 08, 2005 1:23 pm

BrowseFolder control for non-installation folder

Postby IanM » Mon Oct 24, 2005 9:14 am

I would like to add a dialog box which allows the user to set the installation folder for their 'user data' as distinct from the Installation folder where the app itself resides.

This would default to $TARGETDIR$/Home. A varaiation on the Installation folder dialog would be perfect and I have adapted this with the Dialog Editore but I cannot see a way to change the default setting for the Folder browse control from 'Installation folder' to, in my case , $TARGETDIR$/Home

Ian

sinan
Site Admin
Posts: 1028
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Mon Oct 24, 2005 5:07 pm

The best way to do this is:

    1) Backup the TARGETDIR variable
    2) Set the TARGETDIR variable to your desired default location for the user folder
    3) Show the destination dialog again - the one that is already hooked up for TARGETDIR. I suggest you save the destination dialog under a new name, add it to your project, and then make the necessary textual-only changes on the dialog, so users know its a different directory they are choosing. But leave the dialog logic intact.
    4) When the dialog returns, write the value of the TARGETDIR variable in a new variable that actually stands for the alternate folder. And restore the real value of the TARGETDIR variable.


Hope that helps!

IanM
Posts: 42
Joined: Tue Mar 08, 2005 1:23 pm

Postby IanM » Mon Oct 24, 2005 5:12 pm

Thanks Sinan,

I should have thought of that!! Any particular reason why the control is constrained like that - might be nice to have it be able tobe settable to a different variable.

Lovely product. :P So much easier than Wise or Installshield

sinan
Site Admin
Posts: 1028
Joined: Sat Nov 13, 2004 8:12 am
Contact:

Postby sinan » Mon Oct 24, 2005 6:56 pm

The reason for this trickery is to make sure that when you choose a folder visually or with the browse button, the text field keeps in sync, and vice versa. Unfortunately at the moment the tree view and text fields are kept in sync only if both are bound to TARGETDIR...hence the trickery.

Thanks for your compliments - please help spread the word!


Return to “Technical Support”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 70 guests