简体   繁体   English

为什么我的Delphi 6程序仅在少数Windows 7系统(InnoSetup)上安装时会触发管理员权限请求?

[英]Why is my Delphi 6 program triggering a request for admin rights upon install on only a minority of Windows 7 systems (InnoSetup)?

I have a Delphi 6 program that for most users installs fine while running under a user account without admin privileges. 我有一个Delphi 6程序,大多数用户在没有管理员权限的用户帐户下运行时安装得很好。 However, on some systems it triggers a request for admin rights. 但是,在某些系统上,它会触发管理员权限请求。 Unfortunately mine isn't one of them so it's hard for me to diagnose this problem. 不幸的是我的不是其中之一所以我很难诊断出这个问题。 I use InnoSetup 5.1.9 to build my install programs. 我使用InnoSetup 5.1.9来构建我的安装程序。

How can I figure out what I need to change about my installation program's configuration to neutralize the need for admin rights on some people's systems? 如何找出我需要更改安装程序配置的内容,以消除对某些人系统管理员权限的需求? It's causing trouble for my system because during installation, certain program data files are being copied into the admin account's application data folder. 这给我的系统带来了麻烦,因为在安装过程中,某些程序数据文件被复制到管理员帐户的应用程序数据文件夹中。 Then when my program is launched under a user account, those files can not be found since they are not in the user account application folder, where they are expected to be. 然后,当我的程序在用户帐户下启动时,无法找到这些文件,因为它们不在用户帐户应用程序文件夹中,而应该在这些文件夹中。

This happens due to default PrivilegesRequired directive value, which is, by default configured to require administrator elevation. 这是由于默认的PrivilegesRequired指令值,默认情况下配置为需要管理员提升。 If you don't need this, simply change in your InnoSetup script, value of this directive explicitly to something like this: 如果你不需要这个,只需将你的InnoSetup脚本,这个指令的值明确地改为这样:

[Script]
PrivilegesRequired=lowest

From the reference: 来自参考:

When PrivilegesRequired is set to lowest , Setup will not request to be run administrative privileges even if it was started by a member of the Administrators group. PrivilegesRequired设置为最低时 ,安装程序将不会请求运行管理权限,即使它是由Administrators组的成员启动的。 Additionally, the uninstall info root key will always be HKEY_CURRENT_USER, and the "common" forms of the Shell Folder constants are mapped to the "user" forms, even if administrative privileges are available. 此外,卸载信息根密钥将始终为HKEY_CURRENT_USER,并且Shell文件夹常量的“常见”形式将映射到“用户”表单,即使管理权限可用也是如此。

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

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