POL_Install_CentralizedUserDirs

Informations

Creator Message
petch

Information

This installer has been approved by the team.

Informations

Platforms:
Downloads: 37899
Wine: System

Feedbacks

Description

When Wine creates a prefix ("virtual drive"), it uses symlinks to make several user special paths (My Documents, My Pictures, etc.) point to closest equivalent Linux directory.

This is fine to allow Windows applications to manipulate user files seamlessly, but can also be annoying (game saves "escaping" the game virtual drive, and littering your Linux directories with files and directories.

This function replace all the virtual drive's symlinks with symlinks to a directory of your choice.

Source code

#!/bin/bash
# Date : (2013-10-31 21-16)
# Last revision : (2013-10-31 21-26)
# Author : petch
# Only For : http://www.playonlinux.com

# Just to be on the safe side
[ -n "$WINEPREFIX" ] || POL_Debug_Fatal "POL_Function_CentralizedUserDirs: Variable WINEPREFIX not set!"

local CENTRALIZED_USERDIRS="$(POL_Config_Read CENTRALIZED_USERDIRS)"
 
if [ -z "$CENTRALIZED_USERDIRS" -o ! -d "$CENTRALIZED_USERDIRS" ]; then
        POL_SetupWindow_textbox "$(eval_gettext 'In what directory do you want to redirect user directories?')" "$TITLE" "$HOME/$APPLICATION_TITLE's user directories"
        CENTRALIZED_USERDIRS="$APP_ANSWER"
        mkdir -p "$CENTRALIZED_USERDIRS" || POL_Debug_Fatal "Could not create the directory"
        POL_Config_Write CENTRALIZED_USERDIRS "$CENTRALIZED_USERDIRS"
fi

find "$WINEPREFIX/drive_c/" -type l -exec sh -c 'echo "fixing {}"; rm "{}"; ln -s "'"$CENTRALIZED_USERDIRS"'" "{}"' \;

Contributions

Filters:

Contribute
Member Message
Gosu Wednesday 23 July 2014 at 10:30
Gosu

Message

Does this Script still work?

It does not seem to be possible to install it via the POL GUI.
I don't really want to mess with my current setting, so can anyone say if this still works?

Replies

Wednesday 23 July 2014 at 10:45
Sub-Question: does this move already existing directories?
Wednesday 23 July 2014 at 13:33
It still works for me from the PoL GUI
And I don't understand what "existing directories" you're talking of; Before the script runs all what exists are symlinks to standard Linux directories, you don't want them to be moved inside Wine virtual drives do you? And the script has no way to tell apart what content was created by Wine from other content

This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmca-notice@playonlinux.com