damirarh / damirscorner-utterances

utteranc.es comments for https://damirscorner.com
0 stars 0 forks source link

/blog/posts/20140804-InstallNetWindowsServiceWithADifferentName.html #6

Open damirarh opened 1 year ago

damirarh commented 1 year ago

Imported

URL: https://www.damirscorner.com/blog/posts/20140804-InstallNetWindowsServiceWithADifferentName.html

damirarh commented 1 year ago

Imported comment written by Derrick Moeller on 2018-01-23T20:51:52

This approach doesn't seem to address the inconsistency that will be created between the service name you specify as an argument and ServiceBase.ServiceName?

damirarh commented 1 year ago

Imported comment written by Damir Arh on 2018-01-25T06:54:31

Why could that be an issue? It wasn't for me at the time.

damirarh commented 1 year ago

Imported comment written by Derrick Moeller on 2018-01-25T16:45:50

There are a couple of issues, but a common one is writing to the Event Log. ServiceBase.ServiceName is used as the event source, the installer in this instance would not create the correct registry changes to enable writing to the Event Log, and if you make the changes manually both services would look the same in the Event Viewer.

damirarh commented 1 year ago

Imported comment written by Damir Arh on 2018-01-25T17:55:29

We haven't encountered that because we weren't writing logs to the Event
Log. Still, it's a fair warning for anyone else planning to use this
approach.

damirarh commented 1 year ago

Imported comment written by Jalaj Nautiyal on 2018-04-11T21:30:20

I want user to input servicename in installer UI and use user input name to set it as ServiceName and DIsplayName. Can you share your expert opinion on this topic?

damirarh commented 1 year ago

Imported comment written by Damir Arh on 2018-04-12T10:44:59

That's very similar to how we were using this approach when I wrote the post. To implement this, you only need to pass the entered value as a parameter to the call installing the service. And of course, also modify the uninstall call accordingly. Also, look at Derrick's comment below, if it affects you in any way.

damirarh commented 1 year ago

Imported comment written by mordiezbeaumont on 2019-01-04T19:05:48

jalajnautiyal 5++

damirarh commented 1 year ago

Imported comment written by BlancVoid on 2019-01-04T19:05:50

derrickmoeller 5++