Wine resets all user folder paths each update

Questions about Wine on Linux
Locked
Xandros Darkstorm
Level 1
Level 1
Posts: 8
Joined: Wed Oct 03, 2018 7:35 am

Wine resets all user folder paths each update

Post by Xandros Darkstorm »

Every time i update Wine-staging, it resets folder paths to current user's home directory (for instance "/home/michaelrosen"). It is very annoying, because i have to reconfigure wine every time i get updates. Is there any way to tell Wine to stop doing that or should i make a proposition in bug-tracker?
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Wine resets all user folder paths each update

Post by Bob Wya »

@Xandros Darkstorm

I added a verb to winetricks (fairly recently) to this end:

Code: Select all

winetricks isolate_home
Ensuring your winetricks version is up-to-date.
See: WineHQ Wiki: Winetricks

Bob
Xandros Darkstorm
Level 1
Level 1
Posts: 8
Joined: Wed Oct 03, 2018 7:35 am

Re: Wine resets all user folder paths each update

Post by Xandros Darkstorm »

Thank you for reply, but this is not what i want. Now wine puts everything straight in my home directory. I just want Wine to preserve my personal paths between updates. My paths look like:
"/home/user/Documents" - For user documents.
"/home/user/Documents/Music" - For user music.
"/home/user/Documents/Videos" - For user videos.
User avatar
dimesio
Moderator
Moderator
Posts: 13207
Joined: Tue Mar 25, 2008 10:30 pm

Re: Wine resets all user folder paths each update

Post by dimesio »

Xandros Darkstorm wrote:Thank you for reply, but this is not what i want. Now wine puts everything straight in my home directory. I just want Wine to preserve my personal paths between updates. My paths look like:
"/home/user/Documents" - For user documents.
"/home/user/Documents/Music" - For user music.
"/home/user/Documents/Videos" - For user videos.
Wine should default to the system defaults for those locations. Have you set them in your desktop environment? For example, on my system, I have set my default music location in KDE to /data1/music, and all my wineprefixes default to that without my having to make any changes in winecfg.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Wine resets all user folder paths each update

Post by Bob Wya »

Xandros Darkstorm wrote:Thank you for reply, but this is not what i want. Now wine puts everything straight in my home directory. ...
The isolate-home verb should keep user shell folders isolated within a WINEPREFIX. There should not be any symbolic links to your Linux HOME directory.

I've some local patches to retain custom symbolic links, for user shell folders in a WINEPREFIX. This would allow them to persist across Wine updates, etc.

I submitted an initial patchset to Wine (main) as part of a larger solution to various / related Wine bugs, on 20 July 2018. This was allocated to Huw Davies shortly afterwards... Then nothing... Basically a really bad experience for any FOSS project. Especially since I spent weeks working on tidying up multiple patchsets, to stack on top of each other.

Bob
Xandros Darkstorm
Level 1
Level 1
Posts: 8
Joined: Wed Oct 03, 2018 7:35 am

Re: Wine resets all user folder paths each update

Post by Xandros Darkstorm »

dimesio wrote:Wine should default to the system defaults for those locations.
Why so? Why Wine even provide user folders path configuration then? I think the reason why user may need to override the default in Wine, because he needs to separate Windows-related data from others. And if it is possible to change paths to those folders, i don't see any reasons why Wine shouldn't keep this part of user configuration between updates. It is frustrating.
dimesio wrote: Have you set them in your desktop environment? For example, on my system, I have set my default music location in KDE to /data1/music, and all my wineprefixes default to that without my having to make any changes in winecfg.
I am using Xfce and i don't see any application which configures those folders, except for Thunar, which can modify bookmarks. I just deleted them (bookmarks), moved all my docs, music and such in my "Documents" folder and re-added bookmarks. I checked environment variables and there was no special variables for user folders, except for paths to user configuration files. By default all applications are pointing in my home directory in all save file dialogs, except for dialogs which remembers last location.
User avatar
dimesio
Moderator
Moderator
Posts: 13207
Joined: Tue Mar 25, 2008 10:30 pm

Re: Wine resets all user folder paths each update

Post by dimesio »

I think having Wine by default use the DE settings for those paths makes sense, and it works in the majority of cases. I'm quite happy that I could set my default documents, music, and video folders once in KDE and not have to change it for every wineprefix I have, because I have quite a few.

But I do agree that it doesn't make sense for Wine to wipe out user customizations on every update, and there's a longstanding bug for that: https://bugs.winehq.org/show_bug.cgi?id=22974. There's a patch attached to that bug, so if you're up to building Wine, you could try it.

As for how to change those default locations in XFCE, I can't really be of help there, as I don't use it. My guess is that even if there's no GUI, there should be a way to do it by editing some config file somewhere. You might want to ask on the Xubuntu forum.
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Wine resets all user folder paths each update

Post by Bob Wya »

@Xandros Darkstorm

You don't actually need to patch Wine to workaround this bug.

Just use a snippet of the winetricks isolate_home verb:

Code: Select all

echo disable > "${WINEPREFIX}/.update-timestamp"
This workaround, to block WINEPREFIX updates, should persist across Wine version updates.

Bob
Xandros Darkstorm
Level 1
Level 1
Posts: 8
Joined: Wed Oct 03, 2018 7:35 am

Re: Wine resets all user folder paths each update

Post by Xandros Darkstorm »

It seems or i already have ".update-timestamp" file with "disabled" word in it. I presume it is from isolate_home script.
I'll wait until next update and see if my problem solved.

I found the way to change paths to user directories. They are stored in "~/.config/user-dirs.dirs".
User avatar
Bob Wya
Level 12
Level 12
Posts: 3068
Joined: Sat Oct 16, 2010 7:40 pm

Re: Wine resets all user folder paths each update

Post by Bob Wya »

Xandros Darkstorm wrote: I found the way to change paths to user directories. They are stored in "~/.config/user-dirs.dirs".
Having poked about in the Wine source code, quite a lot in this area... :shock: :lol:

The first test that Wine makes is to search for a 'My Documents' folder in the Linux user HOME directory (which will generally fail - since most people don't have stupid directory names like this!)
An XDG_DIR* env lookup is the second automatic tests that Wine makes to determine what symbolic links to set for the WINEPREFIX user shell folders. Which is typically what matches on Linux.
A third fallback test exists macOS X default media directories (under the HOME directory).

Bob
Xandros Darkstorm
Level 1
Level 1
Posts: 8
Joined: Wed Oct 03, 2018 7:35 am

Re: Wine resets all user folder paths each update

Post by Xandros Darkstorm »

Update came and my folders are left untouched. Many thanks, guys!
Locked