简体   繁体   中英

adding a service to windows from vb.net

I've created a windows service application and I'm working on the installer for this service application at the moment, as there's lots of user options that need defining.

Previously when I needed to create a service I've just created a .bat file containing a relevant SC Create command in temp and executed it to add my service, however I wondered if there's a way to add the service directly rather than creating and executing a bat file.

You don't need the temporary .bat file. You can run any command through Process.Start without a temporary file.

Maybe you should think about your installer technology though. A VB.NET executable means people will have to run an installer for that first, then start it to have an installer for the service. I would be slightly amused by having to install the installer.

Wix for example can build installer packages that install a service. Other alternatives are out there too (but this one is free).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM