I have a program installed in ProgramData. I use UAB 2.1 to updating app but it's failed because accessing to the path is denied (OK with text files so I think there's problem with UAC). How can I get overwriting rights in ProgramData/MyAppFolder or display a dialog to notice user give overwriting rights for updater.
Many thanks in advance.
Update
I've read an article at Link. It said that You'll want to create your directory and set the ACLs you need at install time. Should I change installation folder to LocalAppData or try to set ACLs at install time according the article.
Apps that update themselves have a hard time under UAC. Your best bet is to partition the code that does the update into a separate exe. Put a manifest with requireAdministrator on that exe. In the main app, leave the code that checks for updates, and have it enable a button or menu item when an update is needed. Put a shield on that button or menu item, and have it launch the separate exe with ShellExecute. The user will get a UAC consent dialog, which they will be expecting because of the shield. The separate exe, because it's elevated, will be able to write to Program Files and other protected areas.