tags:

views:

81

answers:

4

When i install my C# app in window 7, UAC always show. 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?

THanks,

jepe

+2  A: 

Single Package Authoring link text

You'll want to use Windows Installer / Windows Installer XML to make this install behave the way you request.

Christopher Painter
im developing in xp.
Jepe d Hepe
You can create a Windows Installer Package on XP that will meet the specs when run on 7 / 2008.
Christopher Painter
+2  A: 

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.

Sam
-1 for trying to tell me where my programs should go.
danielkza
+2  A: 

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.)

Android Eve
Those choices will ensure that it succeeds without elevating. They don't address why it is elevating.
Kate Gregory
+1  A: 

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:

  • the name contains setup, patch, update etc (eg setup21.exe) and there is no manifest
  • you embedded a manifest that asks for requireAdministrator. You would have done this on purpose in Visual Studio.
  • there is an external manifest (for NewApp.exe it would be NewApp.exe.manifest) in the same folder that asks for requireAdministrator. You would have done this on purpose too.
  • you have right-clicked the exe, and on the Properties Compatibility you have chosen to elevate it, or to run as XPSP2 which for 7 also elevates
  • someone in your company has applied a Group Policy that this installation app should run elevated (unlikely)
  • you once ran it, got a dialog from Windows saying "that may not have worked right" and agreed to try again with "recommended settings"

Do any of these seem likely? If so, correct them and see if the UAC prompt goes away.

Kate Gregory