3

I have developed a WPF application in C# 4.0. This application is installing some other applications (MSI). Due to this I have made below change in application manifest file.

<requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />

After making above changes, Desktop shortcut to the application (app.exe) showing shield symbol with it.

Is there any way to remove this shield symbol from application & desktop short-cut?

I have seen some MSI & Setup.exe, they also install the program on computer but shield icon does not appear with their short-cut icon.

Vipul
  • 1,493
  • 4
  • 22
  • 44

2 Answers2

4

That shield icon exists because of the manifest changes you have made. The way to prevent that is to remove those changes.

I am not sure you need to set that manifest to run an MSI; I believe that running the MSI will itself prompt for elevated privs, so your application should not need elevated privileges itself.

Alternatively, you could have the code that runs the MSI itself demand the admin privs, rather than having the whole application require it, which is what the manifest info does.

Andrew Barber
  • 37,547
  • 20
  • 91
  • 118
  • I am installing 10 other applications, so to avoid UAC prompt with each installation I have changed the manifest file. Is there any other way of getting admin privs on demand? – Vipul Dec 11 '12 at 07:34
  • You *are* getting them 'on demand'. Do you mean something else? @vipul – Andrew Barber Dec 11 '12 at 08:04
  • When I change manifest file application ask for UAC prompt as soon it starts and OS also know in advance that application will require UAC elevation. Is there any way so that I request for UAC later based on user input? – Vipul Dec 11 '12 at 13:25
3

No. The shield indicates that if a user launches the exe, they should expect a UAC dialog. You are asking for that in your manifest. It's all working as designed.

Kate Gregory
  • 18,565
  • 8
  • 53
  • 85
  • gr8..., I will try it. It seems like I should change my application architecture for this requirement and put all code that needs admin privs should be kept in separate assembly. then call that assembly with admin priv when required. – Vipul Dec 12 '12 at 06:05