是否可以从 Delphi IDE 以管理员身份运行应用程序
我正在尝试在 Vista 计算机上调试 Delphi 2007 中的应用程序。该应用程序最初是为 XP 编写的,因此必须以管理员权限运行。我知道我可以将一些信息放入清单中或更新代码,但我正在寻找可以在我的所有项目中使用的快速修复。
有谁知道是否有一种简单的方法可以让 Delphi 在 Vista 中以管理员身份启动应用程序?
I am trying to debug an application in Delphi 2007 on a Vista machine. The application was originally written for XP so it must be run with administrator privileges. I know that I could put some information into the manifest or update the code but I am looking for a quick fix that can be used in all my projects.
Does anyone know if there is an easy way to get Delphi to launch an application as administrator in Vista?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我想如果您在管理员权限下运行 Delphi,所有子进程都将以与 Delphi 本身相同的权限运行。
I suppose if you run Delphi under administrator privileges all child processes will run with the same privileges as Delphi itself.
您可能会考虑应用程序通常如何运行 - 通过请求提升。看起来,如果您以正常安全性生成应用程序,然后它以提升的级别生成自身,那么您仍然可以调试提升的可执行文件。然后您将调试实际用例。
You might consider how your application is normally going to run - by requesting elevation. It would seem if you spawn your application at normal security, and then it spawns itself at an elevated level, then you would still be debugging the elevated executable. Then you would be debugging the actual use case.
在 Vista 下,您可以提升至管理员权限。 此链接显示您如何使用这些从 Delphi 中启动可执行文件。
请注意,Microsoft 使用“提升”一词,而不是“升级”。
问题是:您必须为此重新启动进程,因此您无法调试重新启动的子进程(如果您可以从非提升进程调试提升进程,那将是一个潜在的安全漏洞)。
Under Vista you can elevate to administrator privileges. This link shows you how to start an Executable from within Delphi with those.
Note that Microsoft uses the word elevate, not escalate.
The problem is: you have to restart your process for this, so you cannot debug the restarted child process (if you could debug an elevated process from a non-elevated one, that would be a potential security hole).