Unable to write in 'Documents'

I have had 5 people report my app ‘never starts’ and some report that preferences dont save.
The startup is creating a folder and files in what used to be My Documents (but which I now find is called Documents in later Windows)
I would expect Xojo’s SpecialFolder.Documents to make that change transparent.

But has anyone had issues creating files in Documents recently?
This is still a ‘safe place’ to write files into ?

It does. I have it in my app and works fine. Preferences are best saved in SpecialFolder.Preferences though as that kind of moves it away from user visibility (still writeable).

I would check your code around that folder creation. Sounds like it’s going poof around there.

What I have done is set up a VM with Generic Windows 7 that has UAC on as default same as a home user and also a login that has normal user rights etc (same as a corporate enviroment). This sometimes fishes out permission errors before the user does!

Same here.
Has worked for years.
Yet 5 people in the space of 8 weeks… hmmm
I don’t know how many demo people ran into same issue and gave up…

I’m also suspecting UAC and Virus checkers

For troubleshooting unusual stuff like this, it might be worth having them try the app from a newly created user account to see if the problem still occurs.

Windows has a general C:\Documents folder for all users, and a ~\Documents folder into each user directory which is the “My Documents”.

You should not save the preferences into any of them since it is possible for the administrator to limit access to that folder. Use instead SpecialFolder.ApplicationData.

Bad place to put them, and here’s why: If a user installs the program on a company machine, on which their IT department has moved the location of the User home folder or just the Documents folder’s onto a network drive (for easier maintenance, virus checking, backing up, etc…), and that user disconnects from the network, they won’t be able to reach them. Used to run into that situation more and more with old VB6 versions of our programs.

Take the time to move things to SpecialFolder.ApplicationData as Paul said. I do what was suggested many times on the forums. Have a routine that checks for the files / folders and if they are not there, creates them. It puts them in the proper place and is self-repairing incase the user moves or deletes a file.

[quote=235043:@Jeff Tullin]I have had 5 people report my app ‘never starts’ and some report that preferences dont save.
The startup is creating a folder and files in what used to be My Documents (but which I now find is called Documents in later Windows)
I would expect Xojo’s SpecialFolder.Documents to make that change transparent.

But has anyone had issues creating files in Documents recently?
This is still a ‘safe place’ to write files into ?[/quote]

I note your 2 questions:

  1. But has anyone had issues creating files in Documents recently?
  2. This is still a ‘safe place’ to write files into ?[/quote]

My answer to question 2 first:

  1. Yes, Documents is still THE safe place to write files to. Same for Music, Picture and Videos because these 4 locations are specific and personal to the user that is logged in and the Microsoft’s recommended locations to write user personal and working files.

  2. I note the word recently. If I may assume, this used to work before but happen only recently. If so, are the affected users just upgraded to Windows 10? I read that Windows 10 is reported to have cause permissioning problem to these 4 user location although this does not happen to all that have upgraded. I have not tried upgrading but I did tested with fresh install and did not have this problem.

Note: I agree that preferences should be saved to the user’s AppData folder, which is actually the roaming folder -/AppData/Roaming. This folder can also be sync to user’s other devices/PCs.

https://msdn.microsoft.com/en-us/library/windows/apps/hh465094.aspx?f=255&MSPPError=-2147217396

https://msdn.microsoft.com/en-us/library/windows/apps/mt299098.aspx

It’s a tricky situation.
I ship a lot of support files that I want the users to be able to amend if they like.
Text files , and small bitmaps for example.
I can’t put them in AppData because Windows and OSX both hide that now: many users couldnt find that folder.

Yes, recently. But one says they are on Windows 7. It should affect everyone. (Maybe it does)

(I managed to confuse myself when testing in a VM: having shared Documents from my Mac through VMWare, a Windows 10 install sent the files to my Mac’s drive instead of its own Documents! )

[quote=235127:@Jeff Tullin]It’s a tricky situation.
I ship a lot of support files that I want the users to be able to amend if they like.[/quote]

Just point a folderItem to the subfolder you want in AppData and launch it. That will open the subfolder in a window where the user finds the file.

“It may be a good idea to remove all users: we never know what they will do with our application(s)”
(yes, this is humour)

The same just started happening to me, and I have found two potential causes.

http://www.tenforums.com/general-support/9634-unable-create-save-files-documents-pictures-folders.html

http://www-01.ibm.com/support/docview.wss?uid=swg21108551