本文介绍了如何设计,作为管理员运行在Windows Vista / 7的自动启动应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要我的应用程序基于某些事件来启动和停止Windows服务。问题是,这种应用需求为自动启动Windows启动时运行为提升普通用户(为了停止服务),以及。此外,它需要在与用户界面的托盘。

I have the need for my application to start and stop Windows Services based on certain events. The thing is that this application needs to run as an elevated normal user (In order to stop services), as well as auto start when Windows starts. Additionally, it need to be in the systray with an user interface.

什么是我选择这里?
我想,有至少两个possibillities:

What are my options here?
I suppose that there are at least two possibillities:

  1. 要通过将其放入启动文件夹或使应用程序自动启动.. \运行中的注册表项。但问题是,是否可以不UAC提示对话框每一次Windows启动?
  2. 弹出完成
  3. 在开发安装为系统上运行,用在SYS托盘独立的GUI应用程序Windows服务。但什么是IPC prossibilities我这里为了高架服务和正常SYS托盘的应用程序?
  4. 之间的通信
  1. To make the application auto start by putting it in the Startup folder or in the ..\Run key in the registry. But the question is, can this be done without the UAC prompt dialog pops up every time Windows starts?
  2. Develop a Windows Service that is installed to run as system, with a separate GUI app in the sys tray. But what are the IPC prossibilities I have here in order to communicate between the elevated service and the normal sys tray app?

有什么想法和建议?

推荐答案

肯定去与选项2和专门使用WCF(Windows通信基础)与Windows服务使用wsHTTPS绑定,以便您可以验证的登录用户沟通允许执行的Windows服务托管的WCF服务的操作。

Definitely go with option 2 and specifically use WCF (Windows Communication Foundation) to communicate with the Windows Service using wsHTTPS binding so that you can authenticate that the logged in user is allowed to perform the actions on the WCF Service hosted by the Windows Service.

这篇关于如何设计,作为管理员运行在Windows Vista / 7的自动启动应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-06 01:41