it is anyway more trustworthy to run the checking every time.
thus packaging this with kixtart as self-executable... although that makes the logon start little slower (exe size would be approx 150k) it would always be for sure.
but, if the ok is trusted, there must be something else there than just checking the file-name and it's location... modification time and it's incredients or something needs to match too to be trustable.
FUNCTION COPYKIX($srcfile,$destfile) dim $ IF Exist($srcfile) IF Exist($destfile) $=SetFileAttr($destfile,128) ENDIF IF GetFileSize($srcfile) <> GetFileSize($destfile) OR GetFileTime($srcfile) <> GetFileTime($destfile) OR GetFileVersion($srcfile) <> GetFileVersion($destfile) COPY $srcfile $destfile /h ENDIF ENDIF ENDFUNCTION
[ 02. May 2003, 12:21: Message edited by: Lonkero ]
Loc: Tigard, OR
OK... Added the .OK checks back in..
That way, when you run the NTLOGON.BAT, it will find it..
Portion of the NTLOGON.BAT
if not exist %SystemDrive%\Scripts\kix421.ok %LOGONSERVER%\NETLOGON\Programs\kix421update.exe /q
Here is the code..
DIM $FilesToCopy,$ $tmp='%tmp%\' $srcdir=@scriptdir+'\' $destdir=split('%WINDIR%',':')+':\Scripts\' $msg=LEFT(JOIN(split(@kix,'.'),''),3) $ok=$destdir+'kix'+$msg+'.ok'
IF 0=Exist($destdir) MD $destdir ENDIF
$FilesToCopy='kix32.exe wkix32.exe' IF @inwin=2 $FilesToCopy=$FilesToCopy+' kx16.dll kx32.dll kx95.dll' ENDIF
FOR EACH $ IN Split($FilesToCopy) COPYKIX($srcdir+$,$destdir+$) NEXT
FUNCTION COPYKIX($srcfile,$destfile) dim $ IF Exist($srcfile) IF Exist($destfile) $=SetFileAttr($destfile,128) $state=' >replaced' ELSE $state=' >new' ENDIF IF GetFileSize($srcfile)<>GetFileSize($destfile) OR GetFileTime($srcfile)<>GetFileTime($destfile) OR GetFileVersion($srcfile)<>GetFileVersion($destfile) IF EXIST($destdir+'kix*.ok') Del $destdir+'kix*.ok' ENDIF COPY $srcfile $destfile /h $=WRITEPROFILESTRING($ok,split(split($destfile,'\'),'.'),'KIX',$destfile+$state) ENDIF ENDIF ENDFUNCTION
Loc: Netherlands, EU
way of using registry is indeed a good alternative. We see three possible problems - the HKCU-hive isn't available by W9x logging on. An alternative can be that you put those informative to the HKLM hive. - by using mandatory profiles the registry information we will gone during each logging on. So each time the installation package will reinstall itself on the client with the necessary to do it. - with the general DOS commands you can't check the registry content.
about IF Len($destdir)=0 $destdir=@lanroot ENDIF has to deal with the possibility that the environment variable %windir% doesn't exist. Normally it is not a problem, but we have to deal with all kind of possibilities.
with the current network speed and with the required execution times of iexpress package runs it isn't necessary to check each time you control file kix???.ok. Also for a modem connection it is acceptable.
for testing the control-file in a DOS environment we are restricting to the available DOS commands. f.e. it's size isn't such function.
we are missing the part of removing unwanted kixtart binaries, when they were implemented with an older edition of iexpress packages. Specially when the current location isn't the same as previous locations. f.e. c:\scripts\kix32.exe c:\scripts\kx16.dll c:\scripts\kx32.dll c:\scripts\kx95.dll c:\windows\kix32.exe c:\windows\kx16.dll c:\windows\kx32.dll c:\windows\kx95.dll Do you know which version it will use, when this will be the result. So removing them can be necessary to prevent unexpected errors during using kixtart.
The reduction effort of different guys contains all kind of interesting elements. greetings.
we can make perfect checks with FC but how to check so trustfully...
anyway, the deletion of old files indeed is a thing we need to check... maybe also that on failure of deletion of some file, we also get problems...
then, nowadays as ppl are finally (others than me) getting rid of logon.bat... is there still a need to distribute the executable? over ras it's slow to run logon-from network but with even slow 256kb connection it's already quick enough to not need a dist...