如何使用Inno Setup在文件上设置“以管理员身份运行" [英] How to set 'Run as administrator' on a file using Inno Setup

查看:772
本文介绍了如何使用Inno Setup在文件上设置“以管理员身份运行"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Inno Setup创建安装程序.作为安装过程的一部分,我正在安装Tomcat.在Windows 7上,我遇到这里描述的问题:

I'm creating an installer using Inno Setup. As part of the install process I'm installing Tomcat. On Windows 7 I suffer from the problem described here:

http: //blog.paulbouwer.com/2010/10/23/the-case-of-the-annoying-tomcat-6-monitor/

我可以通过在tomcat7w.exe上手动设置以管理员身份运行"来修复它(问题和根本原因与tomcat7相同),但是我不知道如何通过Inno Setup来实现.

I can fix it by manually setting the 'Run as administrator' on tomcat7w.exe (the issue and the root cause is the same for tomcat7 as well), but I don't know how to do it through Inno Setup.

我正在找到说明以管理员身份运行some_program.exe的线程,但是在这里,该程序是在Tomcat服务启动时启动的(例如,在计算机启动时),因此,我需要一种使用Inno Setup将其标记为以管理员身份运行,而不是实际运行.

I'm finding threads that explain running some_program.exe as administrator, but here the program is started when the Tomcat service starts (e.g. on machine start-up), so I need a way to flag it using Inno Setup to 'Run as administrator' rather than actually run it.

推荐答案

您可以在[Registry]部分中添加一个注册表项,该项会将run as Administrator设置为运行此应用程序的默认操作.

You can add a Registry entry in [Registry] Section that will set run as Administrator as a default action for running this app.

示例:

Root: "HKLM"; Subkey: "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers"; \
    ValueType: String; ValueName: "{app}\tomcat7w.exe"; ValueData: "RUNASADMIN"; \
    Flags: uninsdeletekeyifempty uninsdeletevalue; MinVersion: 0,6.1

这篇关于如何使用Inno Setup在文件上设置“以管理员身份运行"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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