Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Jooel,
One comment..
The .ok provides a convenient "marker" to look for in the NTLOGON.BAT file. While this information can be written/read to the registry, it cannot be read or picked up without an external tool...
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 ]
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
You definitely get the KiXGolf award!
As I stated earlier, "we" as a company are looking at the possibility of going away from this. That is, remembering that this exercise is for people that cannot.
Now, we need to make the OK or marker file more "bullet-proof."
Registered: 2001-01-03
Posts: 6241
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
code:
if not exist %SystemDrive%\Scripts\kix421.ok %LOGONSERVER%\NETLOGON\Programs\kix421update.exe /q
Here is the code..
code:
DIM $FilesToCopy,$ $tmp='%tmp%\' $srcdir=@scriptdir+'\' $destdir=split('%WINDIR%',':')[0]+':\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,'\')[2],'.')[0],'KIX',$destfile+$state) ENDIF ENDIF ENDFUNCTION
Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Wow, Joeel, jeez, I though my monitor is about to explode. What's up with that yellow color Don't surprise an old man like me with this on a Sunday morning!
_________________________
There are two types of vessels, submarines and targets.
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,
Some feedbacks
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...