【问题标题】:UAC prompt while installing from internet explorer从 Internet Explorer 安装时的 UAC 提示
【发布时间】:2013-12-11 11:11:41
【问题描述】:

您好,我们创建了一个安装程序,可以在用户级别安装应用程序。 当我从 cab 文件中提取 setup.exe 并在本地运行时,它不会提示我输入 UAC,而是正常安装并在用户上下文中安装。

应用程序和驾驶室经过数字签名。

但是当我使用一键安装程序安装相同的内容时,它会提示我输入 UAC 并将其安装在管理员上下文中。

任何人都可以阐明为什么相同的 setup.exe 行为不同吗?

我能做些什么来避免这种情况?

我希望我的应用程序在没有管理员权限的情况下安装在用户级别?

【问题讨论】:

    标签: windows-7 installshield uac one-click-web-publishing


    【解决方案1】:

    我的猜测是setup.exe 正在触发UAC setup compatibility heuristic。来自 MSDN:

    User Account Control: Detect application installations and prompt for elevation

    当检测到需要提升权限的应用程序安装包时,系统会提示用户输入管理用户名和密码。如果用户输入有效的凭据,则操作会以适用的权限继续。

    Windows 会尝试检测某些作为安装程序的应用程序(例如,那些在文件名中包含 setupinstallupdate 的应用程序)并将尝试自动提升它们。微软将其作为兼容性黑客:

    • 大多数用户不会意识到他们应该右键单击安装应用程序并选择以管理员身份运行
    • 更少的开发人员将他们的安装程序正确标记为 requireAdministrator
    • 使用 MSI 的开发人员更少,因为它知道如何/何时/是否将其提升为管理员

    您可以通知 Windows 您的应用程序应该以管理员身份运行。为此,您可以将 asInvoker 选项添加到可执行文件的程序集清单中:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
        <assemblyIdentity 
                version="1.0.0.0"
                processorArchitecture="X86"
                name="client"
                type="win32"
        /> 
    
        <description>CodeJunkie Widget Installer</description> 
    
        <!-- Disable Setup elevation compatibility heuristics since we're named setup.exe -->
        <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
            <security>
                <requestedPrivileges>
                    <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
                </requestedPrivileges>
            </security>
        </trustInfo>
    </assembly>
    

    【讨论】:

      猜你喜欢
      • 2010-10-24
      • 2013-12-17
      • 2023-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多