Moving the user data folder to AppData #2470
Replies: 5 comments 1 reply
This comment has been hidden.
This comment has been hidden.
-
|
The location change user-facing issue can be mitigated by creating a shortcut at the usual location perhaps. One thing that would break is Steam cloud-saves: https://steamdb.info/app/2732960/ufs/, so maybe symlinks? But I don't recall how OneDrive interacts with symlinks. Maybe OneDrive can be fixed by pinning the files: https://learn.microsoft.com/en-us/windows/win32/api/cfapi/nf-cfapi-cfsetpinstate |
Beta Was this translation helpful? Give feedback.
-
|
Related #458 |
Beta Was this translation helpful? Give feedback.
-
DocumentsIt makes sense to leave the Documents folder intact for legacy compatibility and ease of use. If there is a Win API call to safely protect Documents from OneDrive, then can do that in the Game Client. AppDataAllow the user to enable the new AppData location for user data with the Game Client. This can be a command line option. Then GenHub can help the user choose the best option and launch the game in the preferred setup. User data migration methods can be outside the Game Client. |
Beta Was this translation helpful? Give feedback.
-
|
Would be neat to have option to enable portable user data as well, I think. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Some thoughts about moving the user data folder, possible issues and solutions
Suggested is to use as new location
C:\Users\<YourUsername>\AppData\Local\Command and Conquer Generals Zero Hour DataSome issues with that are that players should be able to know about this new location, and that multiple clients on a system may not end up using the same data dir.
It would be possible to add a symbolic link so that the Documents dir leads directly to the AppData dir, which solves the issue with multiple clients.
However it is known that OneDrive can't deal with symbolic links (it will just sync as if the data is in Docs), and this may then break stuff over time. Also we may not always have the right permission, or a filesystem that supports symbolic links.
Alternatively we put a shortcut (.lnk file) in the Documents folder (and inside the data folder) to let players know about the new data dir and keep the old folder untouched. This can lead to two datadirs being used when you have old clients installed too (but maybe it's not so bad?).
Migration of old data to the new data dir can be tricky because of OneDrive's "Files On-Demand", people have reported issues before because the game files were offloaded or otherwise locked.
Since GenHub is taking over GenPatcher functionality (like OneDrive fixes I presume) maybe GenHub should handle the data migration and notify players. Code changes to GeneralsGameCode would then simply be to support both data dirs and prefer the one in AppData.
Not changing the user data folder is also a possibility. A OneDrive fix is to mark the generals data dir as "always keep on this device" which GenHub could do and that would prevent some problems already. Localization of the documents folder name (Arabic or Russian etc) is another typical issue, which the game could solve probably by moving to wide chars for any and all paths that point to the user data folder.
¹ Commonly reported issue with Arabic or Russian language of Windows
² Apparently when using a local profile it's possible to use non-ascii in the username, this is not a typically seen issue though
Beta Was this translation helpful? Give feedback.
All reactions