简体   繁体   English

Inno Setup 生产的安装程序需要提升。 我该如何避免?

[英]Installer produced by Inno Setup requires elevation. How do I avoid that?

I have a Inno Setup script that simply installs files into user's local program files dir: C:\\Users{account}\\AppData\\Local\\Programs\\MyAppName.我有一个 Inno Setup 脚本,它只是将文件安装到用户的本地程序文件目录中:C:\\Users{account}\\AppData\\Local\\Programs\\MyAppName。

It shouldn't trigger elevation when I run the installer exe but it does.当我运行安装程序 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}"

What do I need to do to avoid the elevation?我需要怎么做才能避免海拔升高?

By default, Inno Setup-based installers do not include information about privileges they require.默认情况下,基于 Inno Setup 的安装程序不包含有关其所需权限的信息。 That makes Windows do its autodetection.这使得 Windows 进行自动检测。 For example, if the .exe name includes keywords like Setup , it makes Windows ask for elevation.例如,如果 .exe 名称包含像Setup这样的关键字,它会让 Windows 要求提升。 Though even removing those keywords may not help, as the installer can still trigger other rules.尽管即使删除这些关键字也无济于事,因为安装程序仍然可以触发其他规则。

To override the autodetection, use PrivilegesRequired directive .要覆盖自动检测,请使用PrivilegesRequired指令 In particular, set it to lowest .特别是,将其设置为lowest

[Setup]
PrivilegesRequired=lowest

For a problem with Windows 10 requiring Administrator privilegs for uninstall, see:有关需要管理员权限才能卸载的 Windows 10 问题,请参阅:
Workaround for 'Apps & features' in Windows 10 starting a single-user uninstaller elevated Windows 10 中“应用程序和功能”的解决方法启动提升的单用户卸载程序

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM