In my INF I have:

HKCU,SOFTWARE\MyKey,MyValueName,,MyValueData

However, when I install the INF, the entry above gets copied to
"HKEY_USERS\.DEFAULT\Software" instead of "HKEY_CURRENT_USER\Software".

How do I make it go to ""HKEY_CURRENT_USER\Software" ?

Re: INF / HKCU Question by Alexander

Alexander
Wed Jul 23 21:17:28 CDT 2008

The INF may be installed in context of LOCAL_SYSTEM. Especially if it's
signed. Then there is no notion of the current user.

"Jerome" <Jerome@discussions.microsoft.com> wrote in message
news:942D9056-2921-41F6-8945-E353CCABFB30@microsoft.com...
> In my INF I have:
>
> HKCU,SOFTWARE\MyKey,MyValueName,,MyValueData
>
> However, when I install the INF, the entry above gets copied to
> "HKEY_USERS\.DEFAULT\Software" instead of "HKEY_CURRENT_USER\Software".
>
> How do I make it go to ""HKEY_CURRENT_USER\Software" ?
>



Re: INF / HKCU Question by Jerome

Jerome
Wed Jul 23 23:08:00 CDT 2008

Thank you for the reponse. Are you saying it may not be possible? The odd
thing is if I process the AddReg section manually via the SetupAPI
"SetupInstallFromInfSection" from an application, it will copy to
"HKEY_CURRENT_USER\Software". However I would like it to copy there with a
PNP install too. Any idea how I could do this?

"Alexander Grigoriev" wrote:

> The INF may be installed in context of LOCAL_SYSTEM. Especially if it's
> signed. Then there is no notion of the current user.
>
> "Jerome" <Jerome@discussions.microsoft.com> wrote in message
> news:942D9056-2921-41F6-8945-E353CCABFB30@microsoft.com...
> > In my INF I have:
> >
> > HKCU,SOFTWARE\MyKey,MyValueName,,MyValueData
> >
> > However, when I install the INF, the entry above gets copied to
> > "HKEY_USERS\.DEFAULT\Software" instead of "HKEY_CURRENT_USER\Software".
> >
> > How do I make it go to ""HKEY_CURRENT_USER\Software" ?
> >
>
>
>

Re: INF / HKCU Question by GottfriedStckl

GottfriedStckl
Thu Jul 24 03:27:00 CDT 2008

"Jerome" wrote:
> Thank you for the reponse. Are you saying it may not be possible? The odd
> thing is if I process the AddReg section manually via the SetupAPI
> "SetupInstallFromInfSection" from an application, it will copy to
> "HKEY_CURRENT_USER\Software". However I would like it to copy there with a
> PNP install too. Any idea how I could do this?
Correct by default the inf file will use it's root path never as user
account, since during driver startment the current user is most of the time
not signed in.
But as i see, the API Function SetupInstallFromInfSection() has an argument
named
HKEY RelativeKeyRoot. Here you should specify HKEY_LOCAL_MACHINE (i think
this is the suitablest).
And in your inf file use HKR instead of HKCU


> "Alexander Grigoriev" wrote:
>
> > The INF may be installed in context of LOCAL_SYSTEM. Especially if it's
> > signed. Then there is no notion of the current user.
> >
> > "Jerome" <Jerome@discussions.microsoft.com> wrote in message
> > news:942D9056-2921-41F6-8945-E353CCABFB30@microsoft.com...
> > > In my INF I have:
> > >
> > > HKCU,SOFTWARE\MyKey,MyValueName,,MyValueData
> > >
> > > However, when I install the INF, the entry above gets copied to
> > > "HKEY_USERS\.DEFAULT\Software" instead of "HKEY_CURRENT_USER\Software".
> > >
> > > How do I make it go to ""HKEY_CURRENT_USER\Software" ?
> > >
> >
> >
> >

Re: INF / HKCU Question by Alexander

Alexander
Thu Jul 24 10:03:05 CDT 2008

Why do you want data written for the current user only? It doesn't make
sense for a driver. Use HKLM instead.

"Jerome" <Jerome@discussions.microsoft.com> wrote in message
news:EA2DDA5D-BB10-4503-B9D3-AC5008099960@microsoft.com...
> Thank you for the reponse. Are you saying it may not be possible? The odd
> thing is if I process the AddReg section manually via the SetupAPI
> "SetupInstallFromInfSection" from an application, it will copy to
> "HKEY_CURRENT_USER\Software". However I would like it to copy there with a
> PNP install too. Any idea how I could do this?
>
> "Alexander Grigoriev" wrote:
>
>> The INF may be installed in context of LOCAL_SYSTEM. Especially if it's
>> signed. Then there is no notion of the current user.
>>
>> "Jerome" <Jerome@discussions.microsoft.com> wrote in message
>> news:942D9056-2921-41F6-8945-E353CCABFB30@microsoft.com...
>> > In my INF I have:
>> >
>> > HKCU,SOFTWARE\MyKey,MyValueName,,MyValueData
>> >
>> > However, when I install the INF, the entry above gets copied to
>> > "HKEY_USERS\.DEFAULT\Software" instead of "HKEY_CURRENT_USER\Software".
>> >
>> > How do I make it go to ""HKEY_CURRENT_USER\Software" ?
>> >
>>
>>
>>



Re: INF / HKCU Question by Ray

Ray
Fri Jul 25 19:54:39 CDT 2008

The basic answer is that you can't do it.

The more complicated answer is that if you want to do it with a PNP
install, you'll have to do it in a CoInstaller in either a pre-install
or finish-install section, because all drivers in Vista install in the
LOCAL_SYSTEM context.

Jerome wrote:
> In my INF I have:
>
> HKCU,SOFTWARE\MyKey,MyValueName,,MyValueData
>
> However, when I install the INF, the entry above gets copied to
> "HKEY_USERS\.DEFAULT\Software" instead of "HKEY_CURRENT_USER\Software".
>
> How do I make it go to ""HKEY_CURRENT_USER\Software" ?
>


--
Ray