Changing User Data storage location

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
Cen7
Posts: 15
Joined: February 2nd, 2020, 11:16 pm

Changing User Data storage location

Post by Cen7 »

I’m running version 1.14.7 on a Windows 10 machine (a Lenovo Yoga 730-13, to be very, very specific). Back in the olden days, there was an option when installing BfW to have the user data stored in the same location as the game, itself, but that seems not to be available anymore. I’m wondering if there’s a way to do this manually?


More background, because context often matters:

To make my BfW available regardless of what machine I’m using, I’ve installed it in my DropBox. (And yes, Yay!, that works!) I really want to store my saved games and downloads there, as well. Windows 10, however (curse those Redmond Trolls!) insists on storing the information at c:\users\[username]\documents\mygames\wesnoth1.14.
User avatar
Iris
Site Administrator
Posts: 6798
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Changing User Data storage location

Post by Iris »

You can edit or create a new shortcut for wesnoth.exe with additional options like so:

Code: Select all

"C:\Users\YourUsername\Dropbox\Wesnoth 1.14\wesnoth.exe" --userdata-dir .\userdata --userconfig-dir .\userdata
The quotes surrounding the full path to wesnoth.exe are not optional if there are spaces in any folder names.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.
Cen7
Posts: 15
Joined: February 2nd, 2020, 11:16 pm

Re: Changing User Data storage location

Post by Cen7 »

Thanks! I will try that.
Cen7
Posts: 15
Joined: February 2nd, 2020, 11:16 pm

Re: Changing User Data storage location

Post by Cen7 »

Okay, one thing to know about me is that I’m really slooooooooow (perhaps in more ways than one?), so I’m just now getting around to implementing this.

Problem: I’ve added the suggested language, but it’s not working. Specifically, the shortcut isn’t working at all with that addition. (I.e., it doesn’t open BfW.) Obviously, I’m doing something wrong.

Here’s what I did:

(A) I created a shortcut (you know, right-click on the app wesnoth.exe and choose the option “Create shortcut.”
(B) Opening up the shortcut (right-click, then choose “Properties”), I get a box with multiple tabs and multiple entries, but the default tab is “Shortcut,” which has what I think we’re looking for.
(C) In that tab, there were two specific fields that might be where the information goes. The first, “Target,” is pre-filled with “C:\Users\[my name]\Dropbox\Games\Battle for Wesnoth\wesnoth.exe”. (Quotation marks already included.) The second, “Start in,” is profiled with “C:\Users\[my name]\Dropbox\Games\Battle for Wesnoth”. (Again, already with the quotation marks.) As only “Target” includes the full path, all the way to wesnoth.exe, I thought that’s where it should go, so it now reads:

“C:\Users\[my name]\Dropbox\Games\Battle for Wesnoth\wesnoth.exe” --userdata-dir .\userdata --userconfig-dir .\userdata

(Punctuation and spacing exactly as written.)

Have I missed something that’s obvious to real coders?

EDIT: :shock: So . . . a little Google search, and it looks like I needed to add an “=” and take out the space before “.\userdata” — and now it seems to be functioning!
Cipher
Posts: 4
Joined: April 12th, 2023, 3:21 am

Re: Changing User Data storage location

Post by Cipher »

Trying to do the same thing, but I'm having an issue and not sure what it is. (FWIW, this is now version 1.16.8, on Windows.)

"C:\Users\[name]\iCloudDrive\Battle for Wesnoth\wesnoth.exe"--userdata-dir=.\userdata --userconfig-dir=.\userdata

Everything within the quotation marks was pre-written. I added the rest (userdata etc.), putting the "=" in place of spaces. Note this exactly how the Cen7 example was done. (I know, because I have access to his machine.) But when I try to save, I get the error, "The name . . . specified in the Target box is not valid. Make sure the path and file name are correct.

I've tried creating a userdata folder in my wesnoth folder, as well as copying over all the cache, data, etc., files from the My Games folder (and deleting the files in that location). Still the same error. I'm running out of ideas. :(

EDIT: Seeing this post -- viewtopic.php?t=56549 -- I also tried putting in the *full* pathway to userdata for both the userdata-dir and userconfig-dir commands, trying it both with the "=" signs and with spaces instead of the equal signs. Still the same error.
User avatar
Ravana
Forum Moderator
Posts: 3000
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: Changing User Data storage location

Post by Ravana »

You seem to be missing space between " and -
Cipher
Posts: 4
Joined: April 12th, 2023, 3:21 am

Re: Changing User Data storage location

Post by Cipher »

Wow! You're right: that's all it was.

Thank you.
Cipher
Posts: 4
Joined: April 12th, 2023, 3:21 am

Re: Changing User Data storage location

Post by Cipher »

Consternation! I spoke too soon: adding that space ended the error message and allowed me to "apply" the change, but now the shortcut no longer works: I click on it, and it does nothing. (Same is true if I also right-click on the shortcut and select "run").

Here's the current Target line: "C:\Users\[username]\iCloudDrive\Battle for Wesnoth\wesnoth.exe" --userdata-dir=C:\Users\[username]\iCloudDrive\Battle for Wesnoth\userdata --userconfig-dir=C:\Users\[username]\iCloudDrive\Battle for Wesnoth\userdata

I've tried it with both the "=" and with a space where the "=" is. Same result. (Also tried deleting the shortcut, recreating it and making this edit to Target. Same result.) Undoubtedly, I'm missing something very simple yet again. I just don't know what.
gnombat
Posts: 706
Joined: June 10th, 2010, 8:49 pm

Re: Changing User Data storage location

Post by gnombat »

Cipher wrote: April 13th, 2023, 12:55 am Here's the current Target line: "C:\Users\[username]\iCloudDrive\Battle for Wesnoth\wesnoth.exe" --userdata-dir=C:\Users\[username]\iCloudDrive\Battle for Wesnoth\userdata --userconfig-dir=C:\Users\[username]\iCloudDrive\Battle for Wesnoth\userdata
That's probably not going to work because you have spaces in your --userdata-dir and --userconfig-dir arguments. So to the program, it looks like the arguments are:
  1. --userdata-dir=C:\Users\[username]\iCloudDrive\Battle
  2. for
  3. Wesnoth\userdata
  4. --userconfig-dir=C:\Users\[username]\iCloudDrive\Battle
  5. for
  6. Wesnoth\userdata
Some things you can try:
  1. Probably the simplest thing to do is to just go back to using .\userdata, which should work fine
  2. You could rename the folder Battle for Wesnoth to something without spaces, like BattleForWesnoth or simply Wesnoth
  3. You might be able to get it to work by using quotation marks
Cipher
Posts: 4
Joined: April 12th, 2023, 3:21 am

Re: Changing User Data storage location

Post by Cipher »

Thank you. That explains much.

I actually got it working by reverting to the relative(?) reference: --userdata-dir=.\userdata etc.

I'm learning. Thank you for all your help. :)
Post Reply