Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Windows service name
#1
When building an Intraweb app as Windows service, the Name used is from TIWServerController.AppName. This name can't use spaces. 
A customer would like to have the service named like 'CompanyName ApplicationName'.
TIWServerController.DisplayName can be used for this.

Isn't it possible to use this DisplayName for the name of the Windows Service?
I understand that this could be a breaking change for existing applications.
Reply
#2
I'll have to think about it. The name of the service can't contain spaces but the display name can. We should, in theory, follow these rules
Reply
#3
Hi Alexandre,

I also mean the display name of the service. Attached a screen shot with underlined the name I would like to include spaces.


Attached Files Thumbnail(s)
   
Reply
#4
(04-12-2022, 05:28 AM)Alexandre Machado Wrote: The name of the service can't contain spaces

There is no such restriction at the OS level. The only characters that can't be used in a service name are '/' and '\'. All other characters are fair game, including spaces. When I browse through the installed services on my machine, there are a number of services that have spaces in their names.

(04-12-2022, 05:28 AM)Alexandre Machado Wrote: We should, in theory, follow these rules

There is no rule that says spaces can't be used in service names.

Reply
#5
Internally the service name is also a component name, so it can't contain spaces because of a limitation of Delphi component names, not OS.

BTW, the service name is irrelevant for all practical purposes. My Brave browser update service is named "brave". And the "BitLocker Drive Encryption Service" is named "BDESVC". This is just an entry in the registry with no other meaning.
Reply
#6
(04-12-2022, 10:40 PM)Alexandre Machado Wrote: Internally the service name is also a component name, so it can't contain spaces because of a limitation of Delphi component names, not OS.

How about adding a new ServiceName property? Default it to the component name, but let the user customize it if desired.

(04-12-2022, 10:40 PM)Alexandre Machado Wrote: BTW, the service name is irrelevant for all practical purposes. My Brave browser update service is named "brave". And the "BitLocker Drive Encryption Service" is named "BDESVC". This is just an entry in the registry with no other meaning.

Perhaps, but that doesn't negate the fact that spaces are allowed and supported by Microsoft. On my machine, I have services installed that have names like "Apple Mobile Device Service", "AVG Antivirus", "Bluetooth Device Monitor", "Bonjour Service", "Dell Hardware Support", etc. Those are the actual service names, not just descriptions.

Reply
#7
Remy,

A new property could be added, sure. But, see, IntraWeb has been around for 20+ years, I've been personally involved for 10+, and this is the first time a request like this has come to me.
I think it's fair to ask what's the reasoning behind it ("because I'd like to" is also an acceptable reason, although not a good one). What's the need for something that is - for all practical purposes - irrelevant even to system administrators (unless they think that the service description column on the task manager is not enough to identify the service)?

Please also notice: 

Service Name is the Registry key under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ and uniquely identifies the service

However, in the Services Console (or Component Services), the column "Name" is actually the "Display Name" of the service. The Service Name column is not visible on that list by default. The "Description" column contains the long description of what that service does. 

To make things a little worse, if you open the Windows Task Manager, on the "Services" tab, there is a column Name. One would expect it to contain the Display Name - the same as the services console - but it actually contains the Service Name. Similarly, one would expect that the column Description would contain the long service description, but no, it contains the Display Name. Well done, Microsoft!  Tongue
Reply
#8
@Jeroen

DisplayName property will be used instead of AppName to set the Display Name of the service, when installing, starting from v 15.2.54.

Cheers
Reply
#9
Thanks Alexandre.
Reply
#10
(04-14-2022, 02:15 AM)Alexandre Machado Wrote: Please also notice: 

I'm aware of those points. I've written a number of window services myself over the years.

(04-14-2022, 02:15 AM)Alexandre Machado Wrote: Service Name is the Registry key under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ and uniquely identifies the service

I have a number of services installed that have spaces in their Registry key names.

(04-14-2022, 02:15 AM)Alexandre Machado Wrote: However, in the Services Console (or Component Services), the column "Name" is actually the "Display Name" of the service. The Service Name column is not visible on that list by default.

However, if you double-click on a service to display its properties, its Service Name, Display Name, and Description are all shown in the dialog.

(04-14-2022, 02:15 AM)Alexandre Machado Wrote: To make things a little worse, if you open the Windows Task Manager, on the "Services" tab, there is a column Name. One would expect it to contain the Display Name - the same as the services console - but it actually contains the Service Name.

I have a number of services shown there that have spaces in their names.

(04-14-2022, 02:15 AM)Alexandre Machado Wrote: Well done, Microsoft!  Tongue

Totally agree!

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)