0

How do I add write and modify permissions to a text file that will be installed in the Application Folder in the File System on Target Machine?

Erik Van Moon
  • 47
  • 1
  • 1
  • 7
  • What tool are you using to make your MSI file? WiX? Installshield? Advanced Installer? Etc... Some differences between the tools despite similarities. – Stein Åsmul Oct 17 '18 at 21:41
  • No time to write this up right now, but here are two links to get you going: [How to deny folder permission to Users with wix installer](https://stackoverflow.com/questions/49543312/how-to-deny-folder-permission-to-users-with-wix-installer) and [Different WiX elements to set ACLs](https://stackoverflow.com/questions/49324552/is-wix-changing-the-permissions-on-my-notes-ini-file/49325684#49325684) (mid section). – Stein Åsmul Oct 17 '18 at 23:30

1 Answers1

1

Your post seems to indicate that you are using Visual Studio setup projects, the Installer add-on.

Two basic points:

  1. There is no support for doing this in Visual Studio setup projects, so you would need to write custom action code that alters those permissions. The code to do that is about security APIs, so you probably won't get an explicit answer here.

  2. The most common reason people do this is that the application needs to update the file, and it fails because updating ProgramFiles folder content requires administrator privilege. If this is the case then your application design should be improved by having the file in (say) the User's Application Data folder, which has that name for the obvious reason that's the preferred location for such data.

PhilDW
  • 20,260
  • 1
  • 18
  • 28