2

I have a .NET setup project that deploys an SDF file to the Application Folder that is created. However, in Windows 7, it seems that the permissions do not allow the program to write to this file, readonly! In XP, the installer seemed to work fine.

So, is there a way to change the file permission of this file? I treid using ORCA to do it, but don't really want to have to chagne the MSI everytime I recompile it in VS 2010.

I also tried looking at User's Personal Data Folder, but how do I create a folder named [Manufacturer]/[ProductName]? Do I have to hard code it?

What are the best options out there?

cheers

gabs247
  • 21
  • 1
  • 2
  • 2
    It is not a file permission problem, UAC prevents apps from writing files that are stored in c:\program files. You just need to copy the .sdf file to a folder where you can write. AppData. – Hans Passant Oct 25 '11 at 02:20
  • @HansPassant Users also cannot write to the common AppData folder (`CSIDL_COMMON_APPDATA`). He wants a way to have MSI grant permissions for users to modify application data common to all users. – Ian Boyd Nov 30 '12 at 14:40
  • @gabs247 Any idea to get some details on the way you managed to chnage folder permissions using ORCA – Sebastian Sep 06 '18 at 05:30

1 Answers1

0

A solution is to request elevation through an application manifest. This way your application is always launched with Administrator privileges.

Another solution is to set folder permissions during install. Here is thread discussing this: folder pemissions: Full control granted to all users

Community
  • 1
  • 1
Cosmin
  • 21,216
  • 5
  • 45
  • 60