I have a problem with UAC on Vista/7.
My installer with UAC Execution Level requireAdministrator installs and runs my app.
So first time app runned by installer, it runs as administrator. Then, app creates some files to store self state.
Later (if app launched by user, not as administrator) app can only read from created files, but can't overwrite them.
I tried to disable UAC in the app manifest, or build app without manifest but result still same -- every file created when app runned as administrator can't be overwritten when app runs as user. I tried some other installers like Inno Setup but there nothing like my problem... So my question -- why it happens in my case and how to fix it ? Thanks.
P.S. Important notes
Are your installing application for current user only or for all users on the machine?
For per-user installation it makes sense for the installer to create initial application state in the user's AppData folder. MSI runs per-user installations NON-elevated, so there is no problem with files in AppData folder your applications cannot modify.
For per-machine installation it does not make sense to put anything to the specific user's AppData folder or anywhere under users profile location. New users can logon on the machine after application is installed and they would not have anything there.
That said, you have three solutions (actually two solutions and one hack):
(#3) is a hack and I don't recommend it, because your application would be broken for new users, or when user re-creates his profile on machine.