I am trying to include a file that with my Windows Forms application that be read-write for all users. I was able get the Setup Project to install files to the ProgramData folder using a custom folder with DefaultLocation property set to [CommonAppDataFolder]. I was also able to get my program to read these files using Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) . But the files are all marked as read-only for Users.
Is there another folder I should be installing these files to that will offer common access to all users with read-write permissions?
I found a few threads here, here, and here. But they don’t answer the question which folder should I be using to get read-write common access for all users.
Any thoughts appreciated.
Thanks in advance.
Creating a subfolder in the CommonApplicationData folder, and setting permissions during installation is correct and is the Microsoft “One True Way”:
This is because some applications may legitimately not want regular users to have write access to the folder, perhaps only to allow a service account to write to the central location.