views:

105

answers:

4

I have a simple app that I just tried the installer (Innosetup) on win7(32-bit).

After I install it the program icon on the desktop gets that shield on it that notifies the user that the app demands elevated privileges. I thought it was something wrong with the installer and made on using NSIS instead, same problem.

Does anyone know why it does that on this computer but not on xp-32, win7-64 bit or Vista 64-bit?

If I allow the app to run (Answers yes to the system prompt) it crashes with only the error " has encountered an error. Windows is looking for a solution" and then closes.

A: 

I can answer at least one of your questions:

You will not see the shield icon on XP because there is no concept of elevation in WinXP. WinXP does not support the UAC that was first introduced in Vista.

However, Vista32/64 and Win7-32/64 all support UAC, so I can't imagine why there would be a difference in behavior in just Win7-32. Did you tinker with the UAC settings in the other OSes you're testing?

William Leara
+1  A: 

This is probably not related to the installer, but the target of the shortcut (Your application?)

If windows believes that a shortcut points to a program that requires elevation, it will display the shield overlay icon. It will display it if the target has a manifest with a requestedExecutionLevel of requireAdministrator (And highestAvailable if you are admin) OR the target does not have a "Vista" manifest and windows detects that this is a patch/setup/install application or an application with compatibility problems.

I'm guessing your application does not have a manifest. If you want to remove the overlay, try adding a manifest with requestedExecutionLevel asInvoker (Not that this will turn off virtualization and other compatibility stuff for that application)

Anders
+1  A: 

Most likely this is related to the "program compatibility assistant" thinking your application is non-compatible (as you haven't specified it is) and "guessing" that it requires elevation.

Try adding a correct Application Manifest to indicate that elevation is not required, and that Vista and Windows 7 are both supported operating systems... Here's an example:

<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
         <requestedExecutionLevel level="asInvoker" uiAccess="False">
         </requestedExecutionLevel>
       </requestedPrivileges>
    </security>
  </trustInfo>
  <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
     <application>
        <supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"></supportedOS>
        <supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"></supportedOS>
     </application>
  </compatibility>
</assembly>
sascha
+1  A: 

I had the same problem as yours on a Windows 7 machine installed via an NSIS installer: the application had the "shield" icon over the launcher and the desktop shortcut.

We resolved it adding this simple line to the NSIS script that creates our installer:

RequestExecutionLevel user

http://nsis.sourceforge.net/Docs/Chapter4.html (search for UAC)

Hope this might help resolve your problem.

Milo Casagrande