How to access permission to files after installation?

Today I finally ended creating my app. To install app I used "setup project" from Visual Studio 2019 (image of project type). App is written in C# .NET 4.7.2 Framework. So I added some folders and files (image of files and folders here). So I gave my friend *.msi file, he istalled that and something happened – path access denied. I was surprised because when I installed, everything worked, but on my friend’s PC when app is trying to write something in file, it gives result that it cannot open it (just doesn’t have permission). My friend went to properties of those files and he didn’t have writing permissions (image here in polish language). In that picture in Polish, zapis
mean "writing", so here is my question: how to make setup project in Visual Studio which gives permission to folders/files to modify them?

>Solution :

In general apps don’t have permission to write files to the program folders without elevated permissions. Most apps should write data to the users %appdata% folder you can access that path in c# using:

Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)

Leave a Reply