Winecfg -> browse for folder

Mike Hearn mike at
Wed Nov 24 07:48:03 CST 2004

On Wed, 24 Nov 2004 09:58:14 +0100, Robert van Herk wrote:
> Thanks to Mike's help, I succeeded in showing a SHBrowseForFolder 
> thingy, in the winecfg program, so that people can pick a directory they 
> want to use as virtual C drive.


> However, ofcourse, this directory choosing thingy shows the virtual 
> Windows file system, not the Unix file system. Hence, I think we have a 
> tiny bootstrapping problem here. If I just show the user his windows 
> file system, he might not be able to pick the directory he wants.

Yes, this was expected. Just ensure only Z: is mapped during the directory
browser operation. See the code in drive.c to find out how to modify drive
mappings using win32 but to be honest the easiest way would be to make a
copy of the current configuration data, modify it so only Z: is mapped,
run the picker and then restore the config afterwards with the new drive
the user selected mapped.

Wine *should* be able to respond to drive remappings on the fly like this.
If it can't we need to fix that first.

> Is Z:\ always mapped to the root of the unix file system? Because that 
> would seem to solve it: just let them choose a directory from Z:\ and 
> then probably modify the returned string by removing Z: and replacing 
> all /'s bij \'s.

No not always, it's not enforced by Wine. It could be any drive.

Just back up the current config, ensure only Z: is mapped to / and then
run the picker. You may need to adjust the winecfg drive management API a

We then have the UI issue of this random Z thing in the directory browser
but we can introduce a magic Wine flag specifically for winecfg to improve
usability here. That can be dealt with later.

Have a go at writing the patch, post it here, and we'll go from there.

thanks -mike

More information about the wine-devel mailing list