Use hivesys.inf file for presetting Registry keys

  • Thread starter Thread starter Ben-Zion Joselson
  • Start date Start date
B

Ben-Zion Joselson

I intend to setup Windows 2000 Professional, slipstreamed
with SP4, on my standalone workstation, using a custom
bootable CD.
Before setup I will change the boot order among the
existing SCSI drives, and I want to preset the Registry
key HKLM\SYSTEM\MountedDevices during the new setup so as
to set all drive letters to my own liking.
One way is to modify the drive letters in the
MountedDevices key taken from my existing W2K that already
has all drives/partitions signatures.
I propose to use hivesys.inf file for presetting the new
MountedDevices key, using the modified present key as
a "template", and I may also use hivesft.inf and
hivedef.inf for some other Registry keys modifications.
[This is similar in principle to MS article 243996 that
uses hivesft.inf file to Enable Verbose Logging in Windows
2000 GUI-Mode Setup, by presetting the
\CurrentVersion\Setup key.]
However, by comparing the contents of my present Registry
with the existing hive*.inf files in C:\I386, I have
noticed that these hive*.inf files use more than one flag
for each type of value data in the Registry:

For REG_SZ the flags used are 0x00000000, 0x00000002, and
sometimes no flag, or just 0.
For REG_DWORD the flags used are 0x00010001, 0x00010003.
For REG_MULTI_SZ the flag is 0x00010000.
For REG_BINARY the flags used are 0x00030003 and 1
(rarely).
For REG_EXPAND_SZ the flags used are 0x00020000 and
0x00020002.
For REG_NONE the flag is 0x00020001.
Even 'value not set' is represented by two flags:
0x00000010 and 0x00000012.

So my question is: Which of the two or more possible flags
I should invoke to set each given REG data type in the
hive*.inf files that I am going to modify?
Are they fully equivalent and I am free to choose between,
say, 0x00010001 and 0x00010003 for REG_DWORD? And so on.

Please advise.
 
Are they fully equivalent and I am free to choose
between, say, 0x00010001 and 0x00010003 for REG_DWORD?
And so on.

I stumbled into this a year ago.

The entries with 0x<value>+2 are so called NOCLOBBER types
Example:
REG_DWORD_NOCLOBBER 0x00010003

These entries are used for clean installations and OS
updates. If an entry is found during an update NOCLOBBER
values wouldn`t overwrite existing settings.

For clean installs you are free to use either.

Ciao, Walter
 
Thanks a lot, Walter, for this hard-to-find information.
In fact, Microsoft's description of the use of flags
in .inf files ( see INF AddReg Directive at
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/install/hh/install/inf-
format_7soi.asp ) does not mention the alternative
NOCLOBBER types.

As for my own intended use:
If Setup applies my modified hivesys.inf after having
enumerated drives and partitions, then clearly I should
choose the basic flags to overwrite the drive-letters
assigned by Setup with my own drive-letters.

But, if drive enumeration takes place after my hivesys.inf
has preset the MountedDevices key, then I can only hope
that Setup applies NOCLOBBER values and does not overwrite
my preset drive-letters.

Do you happen to have more info' on Registry presetting,
flags etc.?
 
Do you happen to have more info' on Registry presetting,
flags etc.?

Yes, unstructured in my brain. ;-)
But not as much as needed for your issue. I never tried
what you are trying to do.

I'm not getting the full picture of your approach. It
seems to me a quite difficult task, time and brain
stressing to make it work but I found no real purpose for
this task.

Ciao, Walter

PS: HIVESYS.INF is not the only file which will change
HKLM. I always copy all IN_ files to a temporary directory
and run

FOR /R %a in (*.in_) do expand %a %~na.inf

to take a deeper look inside.
 
Thanks for the idea, but I think that modifying a few
hive*.inf files and a few other will be sufficient, so I
will not need to study several dozen *.in_ files. BTW,
most of them are already expanded in the existing Windows
2000 system.
Talking about other files, is it possible to modify the
file lists in txtsetup.sif, layout.inf and dosnet.inf, to
include shortcuts (*.lnk files) intended for target
directories like All Users\Start Menu\Programs etc., in my
proposed new setup? The existing lists of target
directories in txtsetup.sif in the [WinntDirectories]
section refer only to subfolders inside Winnt.
I saw a list of Dirid values reserved for special shell
folders in Microsoft's Using Dirids in
http://msdn.microsoft.com/library/default.asp?
url=/library/en-us/install/hh/install/create-inf_3aav.asp
but I am not sure if those Dirid numbers will be accepted
in txtsetup.sif and in layout.inf.

Any ideas?
 
Talking about other files, is it possible to modify the
file lists in txtsetup.sif, layout.inf and dosnet.inf, to
include shortcuts (*.lnk files) intended for target
directories like All Users\Start Menu\Programs etc., in my
proposed new setup?

Manipulating those files was quite easy in NT but I found W2k acting
quite different.
And I think it is not necessary either. You may add All Users links
and directories any time you like (for example by GUIrunOnce) and all
users will see the links in their menues. A small batch will able to
do all you need.

Ciao, Walter
 
Back
Top