windows - 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}"
我需要做些什么来避免海拔升高?
解决方案
默认情况下,基于 Inno Setup 的安装程序不包含有关其所需权限的信息。这使得 Windows 进行自动检测。例如,如果 .exe 名称包含诸如 之类的关键字Setup
,它会使 Windows 要求提升。尽管即使删除这些关键字也可能无济于事,因为安装程序仍然可以触发其他规则。
要覆盖自动检测,请使用PrivilegesRequired
指令。特别是,将其设置为lowest
.
[Setup]
PrivilegesRequired=lowest
有关需要管理员权限才能卸载的 Windows 10 问题,请参阅:
Windows 10 中“应用程序和功能”的解决方法,启动提升的单用户卸载程序
推荐阅读
- macos - Flutter Desktop - 从 Mac 生成 .exe
- shopify - 如何在多个页面中使用一个部分而不创建它的副本[Shopify]?
- python - 通过 Web3.py 在 Infura 节点获取以太坊 txpool 待处理交易的不同方法
- apache-kafka - 将 2 个具有重叠时间范围的生产者请求合并为一个并返回 2 个原始请求
- python - 使用“或”运算符
- javascript - 引导模式在 React JS 中不起作用
- angular6 - array.filter 不返回过滤结果
- javascript - 在 XSLT 中定义和调用 Javascript 函数
- apache - 如何在 Apache 中重写 URL 路径以避免无限循环
- javascript - 如何使用 Angular 或 javascript 重新加载页面