Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 不同用户帐户(本地系统除外)的Windows service installer_C#_.net_Vb.net_Windows Installer_Installshield - Fatal编程技术网

C# 不同用户帐户(本地系统除外)的Windows service installer

C# 不同用户帐户(本地系统除外)的Windows service installer,c#,.net,vb.net,windows-installer,installshield,C#,.net,Vb.net,Windows Installer,Installshield,这将始终创建指向的Windows服务安装 本地系统 用户(由于null),我想指向localsystem以外的其他东西,不同的用户帐户和密码。在为Windows服务创建installer时,如何指向其他用户帐户?我假设您正在基于标记使用InstallShield编写MSI。你不应该写任何代码。您可以使用ServiceInstall表定义服务。创建一个以EXE作为密钥文件的组件,然后进入“高级”下的“服务”并右键单击以添加新服务。填写所有属性,你就可以开始了 Set objService = ob

这将始终创建指向的Windows服务安装

本地系统


用户(由于null),我想指向localsystem以外的其他东西,不同的用户帐户和密码。在为Windows服务创建installer时,如何指向其他用户帐户?

我假设您正在基于标记使用InstallShield编写MSI。你不应该写任何代码。您可以使用ServiceInstall表定义服务。创建一个以EXE作为密钥文件的组件,然后进入“高级”下的“服务”并右键单击以添加新服务。填写所有属性,你就可以开始了

Set objService = objWMIService.Get("Win32_BaseService") 

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