Question

I have made an application in WPF and it has user profiles, not related to Windows user profiles. It's quite a simple thing, but I need to store those profile files somewhere. As I read, the preffered folders are Appdata, common application data etc. For me, even Documents will do the trick (it's a school project, those things don't really matter that much). My problem is how to make the a for the profiles folder in some of those places, becouse I do not have elevated permissions with my application? I know how to get to them, but not read/write.

I suppose that the installer is ment for that, and I am using InstallShield Limited Edition with Visual Studio 2010, but I don't know how to configure it to make a folder when installing.

Will unsuficient permissions make problems when I succeed in making an app folder, and want to write in it, or they not protected this way?

Tnx in advance.

Was it helpful?

Solution

During an installation you can set permissions on your folder in AppData. For example, you can set full permissions for Everyone. This way your application should have write access in the folder.

In your case you can set permissions through the InstallShield support. Another solution is to use XCACLS.EXE as a custom action.

OTHER TIPS

I would just check if the files exist (using Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), and create a subfolder and write there from your app if not. You almost always have permissions to write there.

An installer pretty much has permissions to write everywhere, because the user has to grant them before running it. However, I don't think the installer is the right place to generate these files. You will have to overwrite them later anyway.

I have found a solution. When creating the installation, in the Shortcuts/Folders segment of the InstallShield configuration, right-clicking somewhere in the tree opens a context menu where it is possible to make APPDATA and similar folders visible, and then configure what you need there i.e creating folders for an application to use. Quite an unintuitive approach, hence it works.

I've already tried it out, writing inside a folder in the APPDATA does not need any special permissions.

This solves my problem. Thanks to all of you :) .

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top