Automated installs (very long)

Jason Gerrity jason.gerrity at sheridanc.on.ca
Tue Oct 7 13:28:26 GMT 1997


Hello Gerald & Louis

You folks are right about the amount of people interested in this stuff.
We Definitely should put our heads together and come up with the ultimate
(if there is such a thing) solution.

Here's what we do...

We have about 300 or so PC's running Win95 (right now, will grow to almost
2,000) they are running from several DEC alphas with D.U. 3.2g and Samba
1.9p17.  We're a college and so the least amount of user intervention
during install the better...

We use the DOS msclient boot disk to boot the pc and the installer has to
log in to connect to the network share where the image is stored (Louis,
you mentioned that you use the linux dos boot, I would be VERY interested
to see how you did this).

Once logged in the .bat file links to the server and uses Rdist4PC to
transfer the image to the local HDD.  We use a utility  called PUTINENV to
read the ethernet address of the NIC and write it to a .REG file on the HDD 

echo REGEDIT4 > c:\rnew.reg                                                   
echo
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\ComputerName\ComputerNa
me] >> c:\rnew.reg
echo "ComputerName"="%STRING%" >> c:\rnew.reg                          
echo [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\VNETSUP
echo "ComputerName"="%STRING%" >>c:\rnew.reg                                  

Very much like you do Louis.

Then once the image is transferd to the LHDD this .Reg file is imported
into the win95 registry.  The one drawback here is that PUTINENV uses some
kind of mixed up & backwards representation of the MAC address.  

So, once the PC's reboots (we have dual-boot so you have to pick win95 as
first O/S to load) the netbios Hostname is the ethernet address.  We then
use Kixtart 95 to do all of our drive linking and registry editing (it is a
very good tools for this).  This script will check for a flag file on the
local HDD (which was transfered with the image) and then run a seperate
script (also a kix script) which restores long filenames, sets up the
default printer and changes the netbios hostname from the ethernet address
to our DNS hostnames.

$cn = readprofilestring("z:\kix\bootp.ini","Vitals", at wksta)

;Setting computer name
$x=writevalue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\ComputerN
ame\ComputerName","ComputerName",$cn,REG_SZ)
$x=writevalue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\VNET
SUP","ComputerName",$cn,REG_SZ)

;Reading values for printer from bootp.ini
$gp = readprofilestring("z:\kix\bootp.ini","Vitals",$cn + "-group")
$pq = readprofilestring("z:\kix\bootp.ini","Vitals",$cn + "-queue")
$pr = readprofilestring("z:\kix\bootp.ini","Vitals",$cn + "-printer")
$ps = readprofilestring("z:\kix\bootp.ini","Vitals",$cn + "-printerserv")
$x=len($pr)
$f = 0
while $x > 0
        if substr($pr,$x,1) = "-"
               if $f = 0
                        $pd = substr($pr,$x+1,len($pr)-$x)
                        $f = 1
               endif
        endif
        $x = $x - 1
loop

;Setting up drive links
if $gp <> ""
     use j: @lserver\+$gp "."
endif
use g: @homeshr "."
use h: @lserver\h "."
use s: @lserver\image "."

;Entering generic printer registry information
run "regedit printers\"+$pd+".reg"

;Writing printer host and queue to registry
$ln=readvalue("HKEY_LOCAL_MACHINE\Enum\Root\Printer\0000","DeviceDesc")
$x=writevalue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\Print\Pri
nters\"+$ln,"Port","\\"+$ps+"\"+$pq,REG_SZ)

;Writing printer values to win.ini file
$dr=readvalue("HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\Print\Env
ironments\Windows 4.0\Drivers\"+$ln,"Driver")
$dr=substr($dr,1,len($dr)-4)
$x=writeprofilestring("win.ini","windows","device",$ln+","+$dr+",\\"+$ps+"\"
+$pq)
$x=writeprofilestring("win.ini","Devices",$ln,$dr+",\\"+$ps+"\"+$pq)
$x=writeprofilestring("win.ini","PrinterPorts",$ln,$dr+",\\"+$ps+"\"+$pq+",1
5,45")
$fi="Postscript,\\"+$ps+"\"+$pq
$x=writeprofilestring("win.ini", "$fi" , "ATM" , "placeholder")

;Setting up DOS printing
$x=addkey("HKEY_USERS\.Default\Network\Persistent\LPT1")
$x=writevalue("HKEY_USERS\.Default\Network\Persistent\LPT1","RemotePath","\\
"+$ps+"\"+$pq,REG_SZ)
$x=writevalue("HKEY_USERS\.Default\Network\Persistent\LPT1","UserName", at user
id,REG_SZ)
$x=writevalue("HKEY_USERS\.Default\Network\Persistent\LPT1","ProviderName","
Microsoft Network",REG_SZ)

;Restoring long file names
shell "s:\utils\doslfn\doslfnbk c: /r /orphans /force /f c:\backup.lfn"

;Deleting the flag file

exit



We also have win311 & DOS 5 clients here so we use NFS and Bootp for them,
so we parsed the Bootptab and created Bootp.ini files which Kixtart uses to
find the appropriate info for the win95 machines:

oa-v207-5-group=oav207
oa-v207-5-queue=oa-v207-e1
oa-v207-5-printer=oa-v207-qms1725
oa-v207-5-printerserv=somewhere
4ee8edc00000=oa-v207-5

>From here the kix script parses the 'qms1725' section from the bootp.ini
file and imports the appropriate .reg file into win95.  We use a packge
called WinInstall to take 'snapshots' of files and the reg before and after
app installs or printers.  This utility will create .reg files with all of
the appropriate changes for anything which we can then import.

So, since each lab may have a different printer and each printer has a
different unix que, we have kixtart parse the bootp.ini file and find out
what the printer type is and the Que to use and sets it for that mahcine.

Sounds kind of complex huh?

All of this is done the first time the Windows 95 machine is booted after
the image was initially transferd.  But to remove that anoying "you have
not logged on..." message you can do this:

$x=addkey("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Prof
ileList\@userid")
$x=writevalue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\
ProfileList\@userid","ProfileImagePath","G:\", REG_SZ)
$x=writevalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\P
rofileReconciliation","ProfileDirectory","G:\", REG_SZ)

Where @userid is a macro from Kixtart that is the login name of the current
user.  If you want to reduce the amount of network traffic (since this
method points everything to G:\ (which is then mapped to the users' home
dir using NIS) you could do this:

if exist("C:\Windows\Profiles")=0
   shell "command.com /c mkdir C:\Windows\Profiles"
endif
if exist("C:\Windows\Profiles\@userid")=0
   shell "command.com /c mkdir C:\Windows\Profiles\@userid"
endif
$x=addkey("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Prof
ileList\@userid") "."
$x=writevalue("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\
ProfileList\@userid","ProfileImagePath","C:\Windows\Profiles\@userid",
REG_SZ) "."
$x=writevalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\P
rofileReconciliation","ProfileDirectory","C:\Windows\Profiles\@userid",
REG_SZ) "."

this will then only store the USER.DAT and USER.DA0 on the local HDD and
transfer it back and forth like M$ intended.  We also use the custom
folders section of the CONFIG.Pol to point the startmenu, etc. to G:\ also.
 This allows for individual desktops without storing their profiles
locally. (remember we have 20,000 users which could fill up a HDD)

Anyway,  There is probably a lot more info here that I am leaving out, and
of course somebody will have better ways of doing things, but this is what
we've come up with so far.

Please share any info or comments,

Jason

Again Louis, I'm very interested in your linux method and image transfer
method.  How did you resolve different NIC's in the machines when the image
is on the server? One disk for each type of NIC ...?



More information about the samba mailing list