Automated installs (very long)

Louis Mandelstam lma at
Wed Oct 8 08:46:13 GMT 1997

On Tue, 7 Oct 1997, Gerald W. Carter wrote:

> Due to the restoration of the registry, the machine will always think
> that it is the first time a user has logged in.  Really annoying and
> confusinf to Freshman :)

I noted earlier in the thread that ideally, I NEVER want to get the "first
time" message.

Well, using some info gleaned from the list, I learnt that (a) the logon
script is executed BEFORE the profile is read and (b) Win95 checks for
exising profile simply by looking at the ProfileList key.

Well, I have a very simple setup now that does exactly what I need:

Firstly, the source tree's registry contains nothing in ProfileList, and
no c:\windows\profiles dir (though I suspect the latter wouldn't cause a

Now, when the user logs in, there is a preexec script set for the netlogon
share which quickly creates a .reg file for the user, which simply



($1 contains the username)

The logon script then imports this .reg file, and by the time Win95 checks
for profiles, it finds it already has an entry for the user, and the
location of the user's profile is in his/her home directory on the server
(someone, I think Gerald, asked about whether this can be a UNC path -
seems to work here)

One problem I have with this setup is that there is a race condition - we
assume the preexec script has completed by the time the Win95 machine
reaches that point in the logon script.   I plan to implement some kind of
mechanism to cause the logon script to wait (or eventually time out) 

Another problem is that you need to be sure that there actually is a
profile for the user in the place you claim it to be, so I'll be adding a
check for that in the preexec which will copy a default profile into the
standard location if there isn't one already.  This will also need to be
covered by the race condition check.

Anyway, the result is that I never get a "first logon" message, and the
user's registry is not kept on C: at all.  Right now, it will result in
entries accumulating in ProfileList until the machine is re-installed, but
that (a) is not a big problem for me as users don't roam very extensively
here and (b) should be easy to fix either by using regedit's undocumented
key delete command-line switch, or doing something in autoexec.bat similar

1. export registry to .REG file
2. remove entries in ProfileList from .REG file using perl.exe or whatever
3. re-create registry from .REG file

..or any of a host of other possible ways one could think of.


Louis Mandelstam              Tel +27 83 227-0712   Symphony  /|\   /|\
Linux systems integration       Research {   } {   }
Johannesburg, South Africa    mailto:louis at (Pty)Ltd {___} {___}

More information about the samba mailing list