Browse for folder

Got a problem you cannot solve? Try here.
gsRon
Posts: 26
Joined: Sun Sep 14, 2008 10:21 pm

Browse for folder

Postby gsRon » Sun Jan 18, 2009 11:17 pm

Is it possible to have a 'Browse for Folder' button at the end of a text box?

I want to get several paths from the user and don't want to put them one per form with drive and directory list boxes.

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Mon Jan 19, 2009 12:51 am

Yes of course. Look at some themes to see how it works or just follow the instructions in the help file.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

gsRon
Posts: 26
Joined: Sun Sep 14, 2008 10:21 pm

Postby gsRon » Mon Jan 19, 2009 5:34 pm

I can see the 'Select Target Folder' and have found the example in a theme. I think the action I am looking for it 'Select Custom Folder' but I don't see how I can receive the value selected back into the text box.

When I select the text box control, in the Receives Information list box, there is no Custom Folder and when I select the browse button, the Writes Values to Variable option is disabled.

I have searched the help but have not found any description of the 'Select Custom Folder' action.

Thanks for your help.

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Mon Jan 19, 2009 11:25 pm

I apologize for the lack of documentation on this issue.

So, step by step:

1. Drag-drop a button and an edit field to the form.
2. Set the name of the button to MYFOLDER.
3. Double-click the button, choose the Select Custom Folder action.
4. Double-click the edit field, set its Receives Information to [Written Variable Value] and set Writes Values to Variable to MYFOLDER.
5. Last but not least, before calling the dialog from your MSIcode script, make sure you call the Set Variable command to declare/pre-initialize the MYFOLDER variable to whatever value you like.
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

jweksej
Posts: 93
Joined: Wed Sep 27, 2006 4:54 am

Postby jweksej » Tue Mar 31, 2009 2:27 pm

>pre-initialize the MYFOLDER variable to whatever value you like.
in previous version value passed via this variable was used to initialize selections on DirectoryListBox, DriveComboBox and FileListBox.
Now this value is ignored, when selection done in dialog is passed back properly.

Attached is the welcome dialog where I've done test on default and empty IA project. The test code is:

label: Welcome Dialog
Set Variable SCRIPT to d:\\IA_Bugs
MessageBox: SCRIPT, $SCRIPT$
Display Dialog: welcome, wait for dialog to return (modal)
MessageBox: SCRIPT, $SCRIPT$

File Attached:

welcome.dfm

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Tue Mar 31, 2009 3:48 pm

DirectoryListBox still works - it shows the assigned folder, as do the newer Explorer style controls such as ShellTree and ShellCombo.

But make sure the control's Receives Information property is set to [Written Variable Value] and that the variable value makes sense for the target control - in your case, that is to say it contains a folder path.
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

jweksej
Posts: 93
Joined: Wed Sep 27, 2006 4:54 am

Postby jweksej » Wed Apr 01, 2009 10:03 am

> DirectoryListBox, DriveComboBox and FileListBox
none of them reflect assigned value.

> make sure the control's Receives Information property is set to [Written Variable Value]
I'm absolutely sure. See attached dlg.

And it is on default, IA created project. No other code changed exept the lines listed

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Wed Apr 01, 2009 11:54 am

Test each control stand alone to ensure no interactions between controls are complicating things first.
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

jweksej
Posts: 93
Joined: Wed Sep 27, 2006 4:54 am

Postby jweksej » Wed Apr 01, 2009 2:34 pm

I've put controls on separate dialogs and displayed them one by one.
Results are really strange.
DriveComboBox shows always system drive (C:) but returns selection properly.
DirectoryListBox interprets path properly with one exeption - when root folder is passed then first subfolder is selected (but root returned). It returns selection properly.
FileListBox interprets drive properly but displays content of root folder, then returns selection properly.
When variable is set to empty string, then FileListBox makes 'Access violation'...

I've WinXP Prof ENG with all current updates (exept NET 3.5).
Old installer (generated using IA7) works fine, when rebuilded under IA8 behaves as described.

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Wed Apr 01, 2009 4:06 pm

I'm unable to reproduce the AV with the variable set to an empty string.

I also think you're confused about folder selection. The selected folder has an open folder icon. In your case that's the root folder.

Also, any reason you're using these antiquated controls instead of their more modern counterparts?
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

jweksej
Posts: 93
Joined: Wed Sep 27, 2006 4:54 am

Postby jweksej » Thu Apr 02, 2009 6:28 am

> any reason you're using these antiquated controls instead of their more modern counterparts?
this is old installer done using IA7 and I wanted to port it to IA8 together with small change of functionality. But you are right - I'll check the new controls. Thanks.

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Thu Apr 02, 2009 8:02 am

The problems with the old controls have been reproduced and are being fixed, with the exceptions as noted above which are your misunderstandings.

Bot sets of controls will continue to be permanently supported, but since your v7 setup also had the new set of controls, I was just wondering why you chose the old fashioned ones?
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/

jweksej
Posts: 93
Joined: Wed Sep 27, 2006 4:54 am

Postby jweksej » Thu Apr 02, 2009 9:12 am

> your misunderstandings
what do you mean exactly? It was done from begining exactly as you described it and it worked fine with IA7

> why you chose the old fashioned ones?
I don't remember why. Maybe I started design from one of default dialog?

jweksej
Posts: 93
Joined: Wed Sep 27, 2006 4:54 am

Postby jweksej » Fri Apr 03, 2009 3:35 am

> the new set of controls
new set works fine and even one crash related to the old controls dissapeared.

Small question:
PTShellList has property ViewStyle. Explorer allows EndUser to select preferred view style. This control does not allow it. Is it possible to allow it easy?

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Fri Apr 03, 2009 10:24 am

Sorry, not supported. However, note that we'll also fix the old controls so people can use them to their heart's content - to that end I repeat that we were unable to reproduce the crash...

At any rate, glad to hear that the new controls are a better substitute for your situation.
Michael Nesmith

InstallAware

Home of The Next Generation MSI Installer

Get your free copy today - http://www.installaware.com/


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 37 guests