Reputation: 909
When I install my C# app in windows 7, UAC always shows. I'm not logged in as Administrator but I want my application to be installed without the UAC. Can you give me ways on how to do it?
Upvotes: 0
Views: 2529
Reputation: 18954
The UAC prompt shows for any number of reasons, none of which is "the code inside the exe calls function X or tries to write to place Y." These include:
Do any of these seem likely? If so, correct them and see if the UAC prompt goes away.
Upvotes: 3
Reputation: 14974
If you want your application to be installed without triggering the UAC, install to %APPDATA% (instead of installing to %ProgramFiles%) and write to the HKCU hive only in the registry (i.e. don't try to write to HKLM, HKCR, etc.)
Upvotes: 2
Reputation: 74909
If you want to install an app without UAC then you can only touch folders that the currently logged in user can write to. Google Chrome does this--it installs the entire application to the user's local application data folder.
It's very non-standard and I would argue MS should prohibit running code from this location, but it's a working solution to requiring administrator/UAC access to install applications.
Incidentally, Google Chrome more recently made a traditional installer available so one user can install it to be used by all users on the computer.
Upvotes: 2
Reputation: 55581
Single Package Authoring link text
You'll want to use Windows Installer / Windows Installer XML to make this install behave the way you request.
Upvotes: 2