如何确保安装程序将以管理员权限运行? [英] How to ensure the setup program will run with administrator rights?

查看:185
本文介绍了如何确保安装程序将以管理员权限运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我使用Inno Setup创建安装程序包,安装程序是否将具有管理员特权以允许其注册DLL等?

If I create setup package using Inno Setup, will the setup program have administrator privileges allowing it to register DLLs etc. ?

此外,如果安装程序包将程序作为其操作的一部分执行,该程序是否将以管理员权限运行?

Also, if the setup package executes a program as part of its operations, will that program be run with the administrator rights ?

推荐答案

这是通过 PrivilegesRequired 指令.

This is controlled via the PrivilegesRequired directive.

设置为admin(默认值)或 poweruser,安装程序将始终与 管理特权.如果设置 是由无特权的用户启动的, Windows会要求输入密码以 具有管理权限的帐户 权限,然后安装程序将运行 在该帐户下.

When set to admin (the default) or poweruser, Setup will always run with administrative privileges. If Setup was started by an unprivileged user, Windows will ask for the password to an account that has administrative privileges, and Setup will then run under that account.

如果安装程序从 [Run] 部分执行程序,则可以通过runascurrentuserrunasoriginaluser标志控制生成的进程的特权.

If the setup executes a program from the [Run] section, then you can control the privileges of the spawned process with the runascurrentuser and runasoriginaluser flags.

这篇关于如何确保安装程序将以管理员权限运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆