【问题标题】:Installer produced by Inno Setup requires elevation. How do I avoid that?Inno Setup 制作的安装程序需要海拔高度。我该如何避免呢?
【发布时间】:2020-06-02 13:46:52
【问题描述】:

我有一个 Inno Setup 脚本,它只是将文件安装到用户的本地程序文件目录:C:\Users{account}\AppData\Local\Programs\MyAppName。

当我运行安装程序 exe 时它不应该触发提升,但它会触发。

[Setup]
AppName=MyAppManager
AppVerName=MyAppManager
AppCopyright=Copyright (C) 2018 Frank Rizzo
AppPublisher=Frank Rizzo
DefaultDirName={userpf}\MyAppManager
DisableDirPage=yes
DisableProgramGroupPage=yes
DisableReadyPage=yes
;UninstallDisplayIcon={app}\MyAppManager.exe
OutputBaseFilename=MyAppManagerSetup
AppID=MyAppManager.1
VersionInfoVersion=0.4

[Files]
Source: "..\bin\debug\MyAppManager.exe"; DestDir: "{app}"
Source: "CleanFiles\MyAppManager.exe.config"; DestDir: "{app}"
Source: "..\bin\debug\ScintillaNET.dll"; DestDir: "{app}"
Source: "..\bin\debug\Elasticsearch.Net.dll"; DestDir: "{app}"
Source: "..\bin\debug\Nest.dll"; DestDir: "{app}"

我需要做些什么来避免海拔升高?

【问题讨论】:

  • 首先从您的安装程序名称中删除 setupinstall 字样。如果 Windows 认为该程序是安装程序,它会自动强制提升,并专门键入这些名称。从技术上讲,任何安装任何东西的应用程序都应该需要提升,而您试图在没有提升的情况下这样做违反了 Windows 准则。您还会遇到大多数 AV 软件和公司组策略设置的问题。

标签: windows windows-10 inno-setup


【解决方案1】:

默认情况下,基于 Inno Setup 的安装程序不包含有关其所需权限的信息。这使得 Windows 进行自动检测。例如,如果 .exe 名称包含像 Setup 这样的关键字,它会使 Windows 要求提升。尽管即使删除这些关键字也可能无济于事,因为安装程序仍然可以触发其他规则。

要覆盖自动检测,请使用PrivilegesRequired directive。特别是,将其设置为lowest

[Setup]
PrivilegesRequired=lowest

有关卸载需要管理员权限的 Windows 10 问题,请参阅:
Workaround for 'Apps & features' in Windows 10 starting a single-user uninstaller elevated

【讨论】:

    猜你喜欢
    • 2013-07-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多