%11% does not include system root?

  • Thread starter Thread starter Lucvdv
  • Start date Start date
L

Lucvdv

I just noticed this:

I specified the file path in a "Service data" resource as
ServiceBinary = "%11%\WimiVNCS.exe".

After FBA finished, I found it in the registry as
ServiceBinary = "system32\WimiVNCS.exe"

Not really a problem, but it was kind of unexpected that it dropped
"C:\Windows".
 
Lucvdv,

Actually, according to documentation the %11% is the "System32".

It must be the TD build script (or related) that expands %11% to something like c:\windows\system32 for files added to Files section
of a component or Configuration.

Btw, for services the image path usually starts with "system32\".

KM
 
Actually, according to documentation the %11% is the "System32".

I don't think that's how you have to read it.

The next column in the documentation lists an example path
("C:\Windows\System32"), so I see it as "the system32 directory's
location".

That would be consistent with DIRID_SYSTEM, which also has 11 as numeric
value, in the DDK and INF files.


Otherwise %50% would be translated to "System16", but the real directory
name is "system", and %52% to "Spooldrivers" instead of
"spool\drivers\w32x86".

It must be the TD build script (or related) that expands %11% to something like c:\windows\system32 for files added to Files section
of a component or Configuration.

Btw, for services the image path usually starts with "system32\".

I wouldn't have noticed it if I hadn't got "Error 2: the system cannot find
the file specified" when I tried to start the service.

The reason for the error turned out to be something else than it said: the
"ObjectName" registry value for the service has to be set explicitly to
"LocalSystem" if the service type has both SERVICE_WIN32_OWN_PROCESS and
SERVICE_INTERACTIVE_PROCESS bits set (type 0x110).

This means that the StartName setting in a Service Data resource has to be
set to ".\LocalSystem". The default is the same, but it doesn't work if
SERVICE_WIN32_OWN_PROCESS is specified.
 
Lucvdv,
The next column in the documentation lists an example path
("C:\Windows\System32"), so I see it as "the system32 directory's
location".

Well.. These examples do not tell me anything since the actual path may vary (not C:\..).
That would be consistent with DIRID_SYSTEM, which also has 11 as numeric
value, in the DDK and INF files.
Yup.
http://msdn.microsoft.com/library/d...xerefpredefinedsystemenvironmentvariables.asp

Otherwise %50% would be translated to "System16", but the real directory
name is "system", and %52% to "Spooldrivers" instead of "spool\drivers\w32x86".

I got your point and I agree that the second column of that table is just symbolic names, not actual paths.
I wouldn't have noticed it if I hadn't got "Error 2: the system cannot find
the file specified" when I tried to start the service.

I noticed that when I just built a system component that defines a services. The ImagePath was expanded to system32\xxxx.exe.
The reason for the error turned out to be something else than it said: the
"ObjectName" registry value for the service has to be set explicitly to
"LocalSystem" if the service type has both SERVICE_WIN32_OWN_PROCESS and
SERVICE_INTERACTIVE_PROCESS bits set (type 0x110).

This means that the StartName setting in a Service Data resource has to be
set to ".\LocalSystem". The default is the same, but it doesn't work if
SERVICE_WIN32_OWN_PROCESS is specified.

http://groups-beta.google.com/group/microsoft.public.windowsxp.embedded/msg/d317e5e27129456d

Although I don't recall if it applies to LocalSystem too but seems like it is the case since you have already tested it.

KM
 
Just noticed that I accidentally sent a wrong link.
Here is the one I was referring to:
http://msdn.microsoft.com/library/e..._2f47a10b-cb46-472f-a0e8-d1dad435d0f4.xml.asp
(or you can read the description in setupapi.h)

Basically, the SetupAPI %dirid%'s are expended properly (absolute path). But TD script (more specifically, a database script and
that can easy be traced) removed the %windir%\ from the ImagePath (!only for services under
[HKLM\SYSTEM\CurrentControlSet\Service]). This is probably done for compability with XP Pro.
 
Back
Top