安装项目-以管理员身份自动运行应用程序 [英] Setup Project - Running application automatically as Administrator

查看:451
本文介绍了安装项目-以管理员身份自动运行应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个简单的问题.

我完成了我的应用程序,并使用Visual Studio中的安装程序项目创建了安装程序.

问题是我需要将应用程序设置为以管理员身份运行,因为它会在运行时创建文件,而Windows不允许我这样做.

当我在.exe上单击右键并选择以管理员身份运行"时,一切正常,但是每次都必须这样做,并且用户将不可能转到根文件夹并每次都执行它想使用该应用程序. :(

有人可以帮我吗?

提前致谢! :)

Hi All,

I have a simple question.

I finished my application and created a Setup using Setup Project in Visual Studio.

The problem is that I need to set the application to run as Administrator ''cause it creates a file on running and Windows don''t allow me to do it.

When I click with the right button on the .exe and select "Run as Administrator" everything works perfectly, but every time I have to do it, and it will be impossible for the user to go to the root folder and do it every time it wants to use the application. :(

Can someone help me?

Thanks in advance! :)

推荐答案

好吧,AFAIK,它是限制它的操作系统,您无法执行任何操作.

这样想,如果允许您自己让任何应用程序以管理员帐户运行,那么您的系统将很容易受到软件攻击!
Well, AFAIK, it''s the operating system that restricts it and you cannot do anything.

Think this way, if you were allowed to let any application run under administrator account by itself then how vulnerable your system would be from software attacks!


不,您不能通过代码来做到这一点.
如果可以的话,那不是安全检查吗?
No you cannot do this via code.
If you could, then it would not be a security check, would it?


这篇关于安装项目-以管理员身份自动运行应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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