0

I'm creating an installation package using visual studio setup project. it all went well and the installation package actually installs my windows app and it runs but when the app attempts to write to a settings.xml file (inside the installation folder and it does not exists previously) i get the access to path [installation folder path]\settings.xml is denied! how can grant permission to the installed app to create\overwrite to a file inside the installation package. another thing my app does is access the clipboard (takes or writes data to clipboard) so do i need to grant my app this permission too and if so how do I tell the setup project to give my app (it installs) these permissions?

p.s. in my original app I set it to full trust p.s. i'm using visual studio 2008

thanks in advance

pnuts
  • 58,317
  • 11
  • 87
  • 139
Amin
  • 101
  • 5

1 Answers1

0

The program files folder has always required admin privilege to write to. That's why there are data folders (like User's Application Data) that limited users can write to.

It's your executable that needs elevation - build it with an elevation manifest so it will ask the user to elevate to have admin rights (assuming the user has admin rights). Even if the user is admin they do not run with admin rights by default. This is the way UAC works.

On the other hand, if you want limited users to be able to use your app then make sure you write data in places like User's Application Data Folder, and don't update any HKLM registry items.

PhilDW
  • 20,260
  • 1
  • 18
  • 28