Skip to content

C&C Generals & ZH won't launch if OneDrive is backing up the documents folder #458

Open

Description

It changes the location of the folder to the onedrive folder, not letting Generals launch, even with GenPatcher. GenPatcher will give an error.

Activity

  1. 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
  2. tintinhamans commented on Mar 20, 2025

    @tintinhamans

    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.

    Image

  3. JeodC commented on Mar 20, 2025

    @JeodC

    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?

  4. tintinhamans commented on Mar 20, 2025

    @tintinhamans

    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.

  5. xezon commented on Mar 20, 2025

    @xezon

    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.

  6. tintinhamans commented on Mar 20, 2025

    @tintinhamans

    Also, the Steam workshop is currently downloading content to this folder so it would also break Steam workshop functionality.

  7. tintinhamans commented on Mar 20, 2025

    @tintinhamans

    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-cfsetpinstate

    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.

  8. dmgreeny commented on Mar 20, 2025

    @dmgreeny

    One drive is so annoying for people who don't use it. And breaks things for people who do use it. Great job, Microsoft.

  9. tintinhamans commented on Mar 20, 2025

    @tintinhamans

    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.

  10. tintinhamans commented on Mar 20, 2025

    @tintinhamans

    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.

  11. added
    BugSomething is not working right, typically is user facing
    EnhancementIs new feature or request
    CriticalSeverity: Minor < Major < Critical < Blocker
    on Mar 20, 2025
  12. added theissue type on Mar 20, 2025
  13. 3 remaining items

  14. tintinhamans commented on Mar 20, 2025

    @tintinhamans

    Not seems critical to me @tintinhamans

    Well it's an issue that prevents the game from launching at all... what would you classify it as then?

  15. added
    MajorSeverity: Minor < Major < Critical < Blocker
    and removed
    CriticalSeverity: Minor < Major < Critical < Blocker
    on Mar 20, 2025
  16. xezon commented on Mar 20, 2025

    @xezon

    It is not a common issue users run into. I have never heard of it. Demoting to Major.

  17. tintinhamans commented on Mar 20, 2025

    @tintinhamans

    It is not a common issue users run into. I have never heard of it. Demoting to Major.

    Currently GenPatcher is applying a workaround for this as it occurs often enough. Although I think the solution from GenPatcher is sub-optimal.

  18. L3-M commented on Mar 20, 2025

    @L3-M

    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!

  19. tintinhamans commented on Mar 20, 2025

    @tintinhamans

    The fix is to uninstall OneDrive or stop it from backing up the Documents folder. Since OneDrive comes pre-installed with Windows!

    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.

  20. DevGeniusCode commented on Mar 20, 2025

    @DevGeniusCode

    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

  21. tintinhamans commented on Mar 20, 2025

    @tintinhamans

    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.

  22. added this to the Stability fixes milestone on Apr 28, 2025
  23. ChristianGalla commented on May 9, 2026

    @ChristianGalla

    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?

  24. ChristianGalla commented on May 10, 2026

    @ChristianGalla

    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.

  25. tintinhamans commented on Aug 10, 2026

    @tintinhamans

    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)?

  26. ChristianGalla commented on Aug 10, 2026

    @ChristianGalla

    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.

  27. OmniBlade commented on Aug 10, 2026

    @OmniBlade

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething is not working right, typically is user facingExecutableIs game code relatedMajorSeverity: Minor < Major < Critical < Blocker

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions