You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
C&C Generals & ZH won't launch if OneDrive is backing up the documents folder #458
ghost changed the title [-]C&C Generals & ZH won't launch if OneDrive is backuping the documents folder[/-][+]C&C Generals & ZH won't launch if OneDrive is backing up the documents folder[/+]on Mar 19, 2025
In the interest of keeping multiplatform in mind perhaps the Documents folder setup should be moved to the game install directory to maintain ease and portability, or use %APPDATA% to align with future XDG_CONFIG_HOME?
In the interest of keeping multiplatform in mind perhaps the Documents folder setup should be moved to the game install directory to maintain ease and portability, or use %APPDATA% to align with future XDG_CONFIG_HOME?
I think this is not easily done at this point. If we do this then we would break compatibility with older versions of the game i.e. we would end up with two folders where maps/replays etc. are stored.
On Windows, by default, the User Data folder needs to stay exactly where it has been for 20 years, otherwise all users need to relearn this and they will have a hard time doing this.
Maybe we should investigate using Windows Cloud Files API to "pin" the folder on creation (replicating the "always keep on this device" the user can also specify manually): API Documentation
My suspicion is that the game does not launch because it does not understand the "placeholder" files that this functionality leaves when files are not available locally.
One drive is so annoying for people who don't use it. And breaks things for people who do use it. Great job, Microsoft.
This issue should also occur with other providers that use this API e.g.: OneDrive, Dropbox, Google Drive, Box, Citrix ShareFile, Sync.com, pCloud, Egnyte, Amazon WorkDocs.
Also good to note: the behavior that OneDrive does is not a redirection/symlink of the MyDocuments folder but an actual proper remapping of CSIDL_PERSONAL.
The game also uses CSIDL_PERSONAL to resolve the correct path of the MyDocuments folder so I do not think that this is the issue.
I don’t agree, this should actually be labeled as a blocker. I’ve been doing tech support for so long time and you’d be surprised how many users report that their game crashes on startup. The fix is to uninstall OneDrive or stop it from backing up the Documents folder. Since OneDrive comes pre-installed with Windows!
I don't think it's our problem that we need to address, it's a Steam+Windows problem, in a Google search I see many complaints from a variety of different games, so it's not specific to generals
I don't think it's our problem that we need to address, it's a Steam+Windows problem, in a Google search I see many complaints from a variety of different games, so it's not specific to generals
Might not be specific to Generals but imo, if we have ability to mitigate/solve the issue we should.
I am not sure which IO call is failing and didn't had a deep look into the source code of this project, but there is a WIN32 API available to determine if a file is not fully locally available: https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants. Maybe it is possible to implement a pre load check using this API and / or use another file access API on Windows that is able to transparently download a file on access.
Maybe the current POSIX implementation has some drawbacks regarding cloud only file access compared to other APIs, like fstream or WIN32?
Summary is that all API calls are working fine if a file is only available in the cloud. On reading it is automatically downloaded in the background. From program perspective it may look like a slower read operation.
Only if a file is not locally available and at the same time the OneDrive synchronization is paused or there is no internet connection, the read operation fails.
It looks like there is no handling of read errors in the current source code, so this could be improved.
Only if a file is not locally available and at the same time the OneDrive synchronization is paused or there is no internet connection, the read operation fails.
So basically, if people select "Always keep files on this device" for the folder then they should always be good (assuming their OneDrive is in a healthy state at the time of doing so)?
Only if a file is not locally available and at the same time the OneDrive synchronization is paused or there is no internet connection, the read operation fails.
So basically, if people select "Always keep files on this device" for the folder then they should always be good (assuming their OneDrive is in a healthy state at the time of doing so)?
Yes, "Always keep files on this device" should work but this should be verified by someone who has mapped their documents folder to OneDrive for this game.
When keeping files on demand active (not using "Always keep files on this device") there could be something I may have overlooked, like a hidden read timeout.
Unfortunately, my documents folder is not mapped to OneDrive, so I only tested the Windows / C++ core IO APIs for single files.
In the interest of keeping multiplatform in mind perhaps the Documents folder setup should be moved to the game install directory to maintain ease and portability, or use %APPDATA% to align with future XDG_CONFIG_HOME?
Bit late to the party to comment on this one, but this is probably the best fix despite issues with compatibility. I think its worth considering for the none retail builds at least because the replays won't be compatible anyway and its potentially possible that things like WorldBuilder will get features that aren't compatible with retail down the road and will also want separating out.
Activity
[-]C&C Generals & ZH won't launch if OneDrive is backuping the documents folder[/-][+]C&C Generals & ZH won't launch if OneDrive is backing up the documents folder[/+]tintinhamans commentedon Mar 20, 2025
This is not related to the game at all but rather to OneDrive's "Files On-Demand" feature.
User should either disable files on-demand or use "always keep on this device" on the relevant folders.
JeodC commentedon Mar 20, 2025
In the interest of keeping multiplatform in mind perhaps the Documents folder setup should be moved to the game install directory to maintain ease and portability, or use
%APPDATA%to align with futureXDG_CONFIG_HOME?tintinhamans commentedon Mar 20, 2025
I think this is not easily done at this point. If we do this then we would break compatibility with older versions of the game i.e. we would end up with two folders where maps/replays etc. are stored.
xezon commentedon Mar 20, 2025
On Windows, by default, the User Data folder needs to stay exactly where it has been for 20 years, otherwise all users need to relearn this and they will have a hard time doing this.
tintinhamans commentedon Mar 20, 2025
Also, the Steam workshop is currently downloading content to this folder so it would also break Steam workshop functionality.
tintinhamans commentedon Mar 20, 2025
Maybe we should investigate using Windows Cloud Files API to "pin" the folder on creation (replicating the "always keep on this device" the user can also specify manually): API Documentation
Specifically
cfsetpinstate: https://learn.microsoft.com/en-us/windows/win32/api/cfapi/nf-cfapi-cfsetpinstateMy suspicion is that the game does not launch because it does not understand the "placeholder" files that this functionality leaves when files are not available locally.
dmgreeny commentedon Mar 20, 2025
One drive is so annoying for people who don't use it. And breaks things for people who do use it. Great job, Microsoft.
tintinhamans commentedon Mar 20, 2025
This issue should also occur with other providers that use this API e.g.: OneDrive, Dropbox, Google Drive, Box, Citrix ShareFile, Sync.com, pCloud, Egnyte, Amazon WorkDocs.
tintinhamans commentedon Mar 20, 2025
Also good to note: the behavior that OneDrive does is not a redirection/symlink of the
MyDocumentsfolder but an actual proper remapping ofCSIDL_PERSONAL.The game also uses
CSIDL_PERSONALto resolve the correct path of theMyDocumentsfolder so I do not think that this is the issue.3 remaining items
tintinhamans commentedon Mar 20, 2025
Well it's an issue that prevents the game from launching at all... what would you classify it as then?
xezon commentedon Mar 20, 2025
It is not a common issue users run into. I have never heard of it. Demoting to Major.
tintinhamans commentedon Mar 20, 2025
Currently GenPatcher is applying a workaround for this as it occurs often enough. Although I think the solution from GenPatcher is sub-optimal.
L3-M commentedon Mar 20, 2025
I don’t agree, this should actually be labeled as a blocker. I’ve been doing tech support for so long time and you’d be surprised how many users report that their game crashes on startup. The fix is to uninstall OneDrive or stop it from backing up the Documents folder. Since OneDrive comes pre-installed with Windows!
tintinhamans commentedon Mar 20, 2025
Yes but these are bandaids, imo the proper fix is to force Windows to "pin" the folder so that files are not replaced with placeholders.
DevGeniusCode commentedon Mar 20, 2025
I don't think it's our problem that we need to address, it's a Steam+Windows problem, in a Google search I see many complaints from a variety of different games, so it's not specific to generals
tintinhamans commentedon Mar 20, 2025
Might not be specific to Generals but imo, if we have ability to mitigate/solve the issue we should.
ChristianGalla commentedon May 9, 2026
I am not sure which IO call is failing and didn't had a deep look into the source code of this project, but there is a WIN32 API available to determine if a file is not fully locally available: https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants. Maybe it is possible to implement a pre load check using this API and / or use another file access API on Windows that is able to transparently download a file on access.
Maybe the current POSIX implementation has some drawbacks regarding cloud only file access compared to other APIs, like fstream or WIN32?
ChristianGalla commentedon May 10, 2026
I did some general testing regarding some C++ APIs (included the ones in this project) and OneDrive: https://github.com/ChristianGalla/ReadTest
Summary is that all API calls are working fine if a file is only available in the cloud. On reading it is automatically downloaded in the background. From program perspective it may look like a slower read operation.
Only if a file is not locally available and at the same time the OneDrive synchronization is paused or there is no internet connection, the read operation fails.
It looks like there is no handling of read errors in the current source code, so this could be improved.
tintinhamans commentedon Aug 10, 2026
So basically, if people select "Always keep files on this device" for the folder then they should always be good (assuming their OneDrive is in a healthy state at the time of doing so)?
ChristianGalla commentedon Aug 10, 2026
Yes, "Always keep files on this device" should work but this should be verified by someone who has mapped their documents folder to OneDrive for this game.
When keeping files on demand active (not using "Always keep files on this device") there could be something I may have overlooked, like a hidden read timeout.
Unfortunately, my documents folder is not mapped to OneDrive, so I only tested the Windows / C++ core IO APIs for single files.
OmniBlade commentedon Aug 10, 2026
Bit late to the party to comment on this one, but this is probably the best fix despite issues with compatibility. I think its worth considering for the none retail builds at least because the replays won't be compatible anyway and its potentially possible that things like WorldBuilder will get features that aren't compatible with retail down the road and will also want separating out.