简体   繁体   English

Windows服务安装程序用于不同的用户帐户(本地系统除外)

[英]Windows service installer for different user account (other than local system)

Set objService = objWMIService.Get("Win32_BaseService") 

objService.Create("usb2",  "usb test",  "c:\usb2.exe", 
 OWN_PROCESS,  NORMAL_ERROR_CONTROL,  "Automatic",  NOT_INTERACTIVE,  null

This always creates Windows service installation pointing to 这总是创建Windows服务安装指向

localsystem 本地系统

user(due to the null), I want to point to something other than localsystem, different user account & password. 用户(由于为空),我想指向除本地系统以外的其他内容,不同的用户帐户和密码。 How do I point to a different user account when I create installer for Windows services? 为Windows服务创建安装程序时,如何指向其他用户帐户?

I'm assuming you are authoring an MSI using InstallShield based on your tags. 我假设您正在根据标签使用InstallShield编写MSI。 You shouldn't have to write any code. 您不必编写任何代码。 You can define your service using the ServiceInstall table. 您可以使用ServiceInstall表定义服务。 Create a component with your EXE as the keyfile and then go down under advanced, services and right click to add a new service. 使用EXE作为密钥文件创建一个组件,然后在“高级服务”下单击鼠标右键,然后添加新服务。 Fill out all the attributes and you should be good to go. 填写所有属性,您应该一切顺利。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows服务在安装时选择用户或系统帐户 - Windows Service Choose User or System Account on Install Windows 服务作为本地系统帐户停留在“启动”状态 - Windows Service stuck on "starting" status as local system account Windows服务监视本地系统时间以启动其他服务? - a windows service monitors local system time to start other services? 在带有“本地系统帐户”的“ Windows服务”下运行时,.NET Windows 7截屏不起作用 - .NET Windows 7 take screenshot not working when running under 'Windows Service' with 'Local System Account' Windows服务(使用用户帐户登录) - Windows service with User account Login 从服务运行msiexec(本地系统帐户) - Running msiexec from a service (Local System account) C#权限问题导致无法从以本地系统帐户身份运行的Windows服务创建文件夹。 - C# Privilege issues creating folders from Windows service running as Local System account. 在本地系统帐户下的 C# windows 服务中打印 PDF 文件 - printing a PDF file in a C# windows service under Local system account 是否可以使用没有 windows 服务的服务帐户(域)在不同的用户(模拟)下运行代码? - Is running code under a different user (impersonation) possible with a service account (domain) without a windows service? 使用服务帐户访问其他用户日历 - Accessing other user calendar using service account
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM