Creating files/folders on Windows 7

This forum is currently in read-only mode.
0 favourites
From the Asset Store
Get Ready for the New Wave of "Bottom Screen" Games!
  • I have a little problem. The game I just released doesn't work properly on Windows 7.

    The reason appears to be the following: it cannot create folders or files. It uses the INI object, the HashTable object and the File object (as well as the Path object) to create a folder for its save and temp files; without these, it cannot function. On Vista and XP, no problem; on 7, nothing happens. No folder, no nothing. (It's not the admin privileges, either.)

    Any ideas or suggestions?

  • Is a simple Construct game, with only the Path and File objects in the project, able to create a folder on Windows 7?

    It's not the admin privileges, either

    I guess this means it is not a permissions issue? I'm assuming you have tried it as admin and it fails as well.

  • I guess this means it is not a permissions issue? I'm assuming you have tried it as admin and it fails as well.

    Yes, several people have tried it.

  • Are the folder names always the same? Couldn't you just create them beforehand with the installer or something?

  • I could. I've tried manually creating them, too - but the game still can't create any files, so the problem remains.

  • Well, this is certainly weird, because I'm on Windows 7 and for example INI file can create files, but not folders. File object can create folders just fine.

    What version of Construct did you build your game in?

    Also, for the record, when I try to run your game, it just stays in black screen and nothing happens. Also, as a recommendation, please don't make the game run fullscreened on first startup.

  • Well, this is certainly weird, because I'm on Windows 7 and for example INI file can create files, but not folders. File object can create folders just fine.

    What version of Construct did you build your game in?

    Also, for the record, when I try to run your game, it just stays in black screen and nothing happens. Also, as a recommendation, please don't make the game run fullscreened on first startup.

    Hmmm. Weird. I'll run a couple more tests.

    The current build was made with 0.99.94.

  • You mean 0.99.84 right?

    Anyway, the game runs for me, looks like I was just having some sort of weird problem earlier. Though I can't say anything about the saving yet since I didn't get so far yet.

  • You mean 0.99.84 right?

    Anyway, the game runs for me, looks like I was just having some sort of weird problem earlier. Though I can't say anything about the saving yet since I didn't get so far yet.

    Yes, I do mean that. I am a silly man.

    More tests indicate the problem may be with the path object. We'll see. It may all be solved soon.

  • If you right click and 'Run as administrator', does it work? Windows Vista/7 have protected file systems, so if you try to write to a protected directory (eg. in Program Files), access is denied unless the application has administrative privileges. For example if your game is installed to Program Files and tries to write files to its own folder, it will be denied access.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If you right click and 'Run as administrator', does it work? Windows Vista/7 have protected file systems, so if you try to write to a protected directory (eg. in Program Files), access is denied unless the application has administrative privileges. For example if your game is installed to Program Files and tries to write files to its own folder, it will be denied access.

    For that exact reason, the current version of the game tries to write the files to My Documents, like a lot of commercial games do. It works fine on Vista and XP, but not at all on 7, even with admin privileges. I thought it might have to do with the fact that 7 structures its folders differently, but I'm not sure.

  • So, either I make the game create its files in AppPath, meaning the player needs admin privileges (given that most players are likely to install the game in Program Files), or... what else could I do?

    Would it make sense to just have the game create a save games folder in C?

  • The folder "my documents" (hope it is called so in english^^) is the default storage location for saved files. It should be writable without admin rights.

  • Access to C:\ is also blocked by Windows, so it doesn't even solve the problem. Besides, having a program write anything to C:\ is obnoxious to the user, and always has been a bad idea.

    The best candidate is probably the user's AppData folder which applications are allowed access to, or you could settle for My Documents if necessary.

  • The folder "my documents" (hope it is called so in english^^) is the default storage location for saved files. It should be writable without admin rights.

    Yes, but Construct seems to be having problems writing to MyDocuments on Windows 7, probably because Windows 7 has different folder structures.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)