Page 1 of 1
after install service: regkey ImagePath has extra space?
Posted: Thu Apr 12, 2007 8:41 am
by daan
Apparently the value ImagePath under HKLM\\SYSTEM\\CurrentControlSet\\Services\\<My> gets an added space at the end.
This poses a problem, since our product does not expect the space to be there.
Is this a known bug?
(Btw: tried to overwrite the key with the correct value, but this fails)
Posted: Thu Apr 12, 2007 10:59 am
by MichaelNesmith
Please do not double-post.
Posted: Fri Feb 22, 2008 2:44 pm
by Chris Miller
I'm seeing this bug with IA 7.5. This is a problem becuase I have a service written in .NET and the configuration program that updates the .config file for that app uses ImagePath and concatenates ".config" to it to get the location of the .config file. This breaks with IA because of the extra space.
Posted: Sat Mar 01, 2008 10:25 pm
by Chris Miller
I don't know if this helps anyone, but I implemented a work around in my service. Or more accurately, the configuration utility that edits the service settings. It uses the ImagePath value to get the path to the service file name so that it can access the .config file (it's written in .NET, most of the settings are in the app.config instead of the registry). I made the configuration utility more tolerant of the values in ImagePath.
An alternative would be to make the service self-registering. I did that when I used Wise For Windows, as their service registration code would fail spectaculiarly with services written in .NET. It's fairly easy to make your service self-registering. The API apparently isn't documented, but the Framewark calls to register as a service are easy enough to use. If anyone needs to do that, I wrote it up
here.