首页 > 解决方案 > Inno Setup 制作的安装程序需要海拔高度。我该如何避免呢?

问题描述

我有一个 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}"

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

标签: windowswindows-10inno-setup

解决方案


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

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

[Setup]
PrivilegesRequired=lowest

有关需要管理员权限才能卸载的 Windows 10 问题,请参阅:
Windows 10 中“应用程序和功能”的解决方法,启动提升的单用户卸载程序


推荐阅读