#7185 - 2001-02-28 10:19 PM
Question about Bryce's login batch
|
Anonymous
Anonymous
Unregistered
|
Bryce I have tested this and I want to implement it, but I was wondering, is there a way to check first to see if the user already has the files on their computer and where up to date? so I wouldn't have to recopy them every time they logged in and still be able to replace them if I update newer files on the server. @Echo Off CLS ECHO Verifying / Updating Script Software Installation, Please Wait...IF "%OS%" == "Windows_NT" GOTO WinNT %windir%\command\XCOPY %0\..\KIX32.EXE %WINDIR%\ /D /H /I /R /V > NUL %windir%\command\XCOPY %0\..\KX16.DLL %WINDIR%\ /D /H /I /R /V > NUL %windir%\command\XCOPY %0\..\KX32.DLL %WINDIR%\ /D /H /I /R /V > NUL %windir%\command\XCOPY %0\..\KX95.DLL %WINDIR%\ /D /H /I /R /V > NUL GOTO RunScript :WinNT XCOPY %0\..\KIX32.EXE %WINDIR%\ /D /H /I /R /V > NUL GOTO RunScript :RunScript ECHO Loading Logon Script, Please Wait... %WINDIR%\KIX32.EXE %0\..\logon.KIX :End
|
|
Top
|
|
|
|
#7187 - 2001-02-28 10:44 PM
Re: Question about Bryce's login batch
|
Anonymous
Anonymous
Unregistered
|
Thanks alot this will work out very well. With %OS% does that detect Windows 2k as WINNT also?
|
|
Top
|
|
|
|
#7188 - 2001-03-02 12:39 AM
Re: Question about Bryce's login batch
|
kjhoskin
Fresh Scripter
Registered: 2001-01-29
Posts: 47
Loc: Plymouth, Devon, UK
|
Are most people coping the kix files to the client PC or running them from the server???We're still in the test phase of our new Win2000 network and at the moment I run kix from the servers. We have around 250 users, 3 DC's, and two sites connected by a fast WAN. Anyone got an opinion on whether to keep running kix on the servers or copy the files to the clients???? Kerry
|
|
Top
|
|
|
|
#7189 - 2001-03-01 01:23 PM
Re: Question about Bryce's login batch
|
Anonymous
Anonymous
Unregistered
|
I have been running it from the network and I had a few complaints that it was slow or taking a long time to login and these computers are on the 10Mhz Lan. Hopefully this will work.
|
|
Top
|
|
|
|
#7191 - 2001-03-01 06:34 PM
Re: Question about Bryce's login batch
|
Anonymous
Anonymous
Unregistered
|
Thanks for the added Information Bryce, I went ahead and implemented the script last night on 350 users and have already seen a difference in login times. ONLY 2200 more to go.Thanks again!!!!
|
|
Top
|
|
|
|
#7192 - 2001-03-26 01:13 AM
Re: Question about Bryce's login batch
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,For the installation of kixtart at your local workstation we see many version of doing it. The most statements are using for this duty. But there is also a way of doing it with a single statement, which doesn't only copy the required files, but also compare file version information. After completion a logfile will be created at your local workstation. At our site http://home.wanadoo.nl/scripting you will find installation packages for kixtart 3.62 + 3.63 For kixtart 3.62 version:
- kix362update.exe
- kix362registry.exe
For kixtart 3.63 version:
- kix363update.exe
- kix363registry.exe
The registry versions install kixtart to your %systemroot% folder and add file associations for kixtart to your HKCR registry keys. So you have additional elements to your menu. The update versions install kixtart also to your %systemroot% folder and remove file associations for kixtart from your registry. Possible calls in your logon procedure can be:
- x:\kixtart\kix362update.exe /q
- %0\..\kix363registry.exe /q
- if not exist c:\kix363.ok %0\..\kix363update.exe /q
After using above programs there will be created a control file c:\kix362.ok or c:\kix363.ok. So it isn't necessary to run the installation process again. remarks: SECURITY LEAK running kix32.exe from a local workstation can have also unwanted effects. An user can modify or replace your kix32.exe file. f.e. not to run your script but for reading your script. For RAS users it is interesting not to download each time the kixtart required files, but for other user we advise: always check the kixtart files and update them when necessary before running your KIX scripts. In our case the first statement of our default logon procedure for network users is: %0\..\kix363update.exe /q remarks: performance An example of debug information of running install.kix, which will be processed during execution of
- kix36?update.exe
- kix36?registry.exe
files.code:
Kixtart 3.63 - W95 debug mode (vs 2.00) 10:44:55Informative INSTALL: copy d:\z\iexpress.363\kix32.exe c:\windows\kix32.exe size.old = 163840 size.new = 163840 time.old = 2000/10/15 00:00:00 time.new = 2000/10/15 00:00:00 company name filedescription KiXtart main executable fileversion 3, 63, 0, 0 internalname KIX32 language 0409English legalcopyright Copyright Microsoft Corp. 1999 legaltrademarks $ originalfilename KIX32.EXE privatebuild productname KiXtart productversion 3, 63, 0, 0 specialbuild Informative INSTALL: copy d:\z\iexpress.363\kx16.dll c:\windows\kx16.dll size.old = 47104 size.new = 47104 time.old = 1999/09/01 00:00:00 time.new = 1999/09/01 00:00:00 company name filedescription fileversion internalname language legalcopyright legaltrademarks originalfilename privatebuild productname productversion specialbuild Informative INSTALL: copy d:\z\iexpress.363\kx32.dll c:\windows\kx32.dll size.old = 32768 size.new = 32768 time.old = 1999/09/01 00:00:00 time.new = 1999/09/01 00:00:00 company name filedescription KiXtart 32 bit Thunk DLL fileversion 3, 60, 0, 0 internalname KX32 language 0409English legalcopyright Copyright © Microsoft Corp. 1999 legaltrademarks originalfilename KX32.DLL privatebuild productname KiXtart productversion 3, 60, 0, 0 specialbuild Informative INSTALL: copy d:\z\iexpress.363\kx95.dll c:\windows\kx95.dll size.old = 36864 size.new = 36864 time.old = 1999/09/01 00:00:00 time.new = 1999/09/01 00:00:00 company name filedescription KiXtart RPC client DLL fileversion 3, 60, 0, 0 internalname KX95 language 0409English legalcopyright Copyright © Microsoft Corp. 1999 legaltrademarks originalfilename KX95.DLL privatebuild productname KiXtart productversion 3, 60, 0, 0 specialbuild logevent = Kixtart-UPDATE 2.00 script completed successfully (10:44:55 - 10:44:58) (kix32.exe kx16.dll kx32.dll kx95.dll) to "c:\windows\"
Kixtart 3.63 update incompleted. ('U:\install\iexpress.363\' -> 'C:\WINDOWS\')
Example of logfile
code:
[Kixtart W95] Kixtart 3.63=installation completed at 2001/03/25 10:44:56 (kix32.exe kx16.dll kx32.dll kx95.dll) to "c:\windows\"
The script code:
code:
IF setconsole("hide") ENDIF ; ; NT/95 logon - Kixtart 3.62, 3.63 ; ; (c) scripting@wanadoo.nl - 2000, 2001 ; ; vs 2.00 - program ; ; 1.00 (20000715) original version. created for IExpress package. ; 1.01 (20000715) - additional information written to check-file. ; 1.02 (20000715) - additional information about starting script. ; system tries to find "c:\temp\kixtart.dbg" file, which will ; create a info file "c:\temp\kixtart.txt". ; automatic remove of "c:\temp\kixtart.dbg" + "c:\temp\kixtart.txt" by next run. ; - change "source_directory" to "c:\temp\ixp000.tmp\", ; because "@curdir" is "@homeshr" directory. ; - CHANGE iexpress package changed. calling command ; "kix32.exe install.kix" ; to ; "c:\temp\ixp000.tmp\kix32.exe c:\temp\ixp000.tmp\install.kix". ; sometime actual drive isn't correct. ; 1.03 (20000730) - add HKCR registry entries to 'edit', 'run', 'run debug' + 'print' kixtart scripts. ; first it will removing existing HKCR registry entries. ; 1.04 (20001025) - update to kixtart 3.63 ; 2.00 (20010320) - use %tmp% variable as temporary path. ; - use @curdir as location of "%temp%\ixp00?.tmp" directory. ; - use flexible "kix36?.ok" file. ; $prgrm_version="2.00" ; $tmp_directory=ExpandEnvironmentVars("%tmp%") IF (substr($tmp_directory,len($tmp_directory),1) <> "\") $tmp_directory=$tmp_directory+"\" ENDIF ; $debug_mode="no" ; - yes/no - IF (@inwin = 1) $NT_mode="yes" ELSE $NT_mode="no" ENDIF ; $os="" SELECT CASE ($NT_mode = "yes") AND (@dos = "5.0") ; - Windows 2000 - $os="W2K" CASE ($NT_mode = "yes") ; - Windows NT - $os="NT4" CASE ($NT_mode <> "yes") AND (@dos = "4.90") ; - Windows ME - $os="ME" CASE ($NT_mode <> "yes") AND (@dos = "4.10") ; - Windows 98 - $os="W98" CASE ($NT_mode <> "yes") AND (@dos = "4.0") ; - Windows 95 - $os="W95" CASE 1 $os="???" ; - undetermined - ENDSELECT $time_start=@time ; IF ($debug_mode = "yes") break on del $tmp_directory+"kixtart.txt" IF (RedirectOutput($tmp_directory+"kixtart.txt",1) = 0) ENDIF $log_info="Kixtart-UPDATE "+$prgrm_version+" script started." IF logevent(0, 1, $log_info, "", "Kixtart UPDATE @kix") ENDIF ELSE break off del $tmp_directory+"kixtart.txt" IF (RedirectOutput("nul",1) = 0) ENDIF ENDIF IF ($debug_mode = "yes") ? "Kixtart "+@kix+" - "+$os+" debug mode (vs "+$prgrm_version+")"+" "+$time_start ? ENDIF ; -------------------------------------------------------------------------- ; - install kixtart at local workstation - ; - - ; - 1. calculates source/destination directory - ; - 2. check for update - ; - - GetFileSize - ; - - GetFileTime - ; - - GetFileVersion - ; - 3. update any kixtart file, when installed version isn't the same. - ; - first it removes unwanted fileattributes - ; - (hidden, readonly, system) - ; - 4a. create information file, which can be checked by batch - ; - procedure. it eliminates a unwanted download + installation. - ; - 4b. log update information to eventvwr log. - ; - - ; - call by installation procedure - ; - fe. "if not exist c:\kix362.ok %0\..\kix362update.exe /q" - ; - "if not exist c:\kix363.ok %0\..\kix363update.exe /q" - ; -------------------------------------------------------------------------- $source_directory=@curdir IF (substr($source_directory,len($source_directory),1) <> "\") $source_directory=$source_directory+"\" ENDIF IF ($NT_mode = "yes") $destination_directory=ReadValue("HKEY_LOCAL_MACHINE\software\microsoft\windows NT\currentversion", "SystemRoot") ELSE $destination_directory=ReadValue("HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion", "SystemRoot") ENDIF IF (len($destination_directory) = 0) $destination_directory=@lanroot ENDIF IF (substr($destination_directory,len($destination_directory),1) <> "\") $destination_directory=$destination_directory+"\" ENDIF ; $max_kix_files=4 DIM $kix_files[$max_kix_files+1] $kix_files[0]="kix"+substr(@kix,1,1)+substr(@kix,3,2)+".ok" ; - check file - $kix_files[1]="kix32.exe" $kix_files[2]="kx16.dll" $kix_files[3]="kx32.dll" $kix_files[4]="kx95.dll" ; $update="no" $update_info="" $i=1 WHILE ($i <= $max_kix_files) $source_file=$source_directory+$kix_files[$i] $destination_file=$destination_directory+$kix_files[$i] IF (exist($destination_file) = 1) IF (setfileattr($destination_file, 128) <> 0) ENDIF IF ($debug_mode = "yes") del $destination_file ; - activates an automatic update for debugging script - ENDIF ENDIF $update="yes" IF (exist($source_file) = 1) $update="no" IF (GetFileSize($source_file) <> GetFileSize($destination_file)) $update="yes" ENDIF IF (GetFileTime($source_file) <> GetFileTime($destination_file)) $update="yes" ENDIF IF (GetFileVersion($source_file,"filedescription") <> GetFileVersion($destination_file,"filedescription")) $update="yes" ENDIF IF (GetFileVersion($source_file,"fileversion") <> GetFileVersion($destination_file,"fileversion")) $update="yes" ENDIF IF (GetFileVersion($source_file,"internalname") <> GetFileVersion($destination_file,"internalname")) $update="yes" ENDIF IF (GetFileVersion($source_file,"language") <> GetFileVersion($destination_file,"language")) $update="yes" ENDIF IF (GetFileVersion($source_file,"originalfilename") <> GetFileVersion($destination_file,"originalfilename")) $update="yes" ENDIF IF (GetFileVersion($source_file,"productname") <> GetFileVersion($destination_file,"productname")) $update="yes" ENDIF ENDIF ; IF ($update = "yes") copy $source_file $destination_file $update_info=$update_info+" "+LCASE($kix_files[$i]) ENDIF IF ($debug_mode = "yes") ? "Informative INSTALL: copy "+LCASE($source_file)+" "+LCASE($destination_file) ? ? " size.old = "+GetFileSize($source_file) ? " size.new = "+GetFileSize($destination_file) ? " time.old = "+GetFileTime($source_file) ? " time.new = "+GetFileTime($destination_file) ? ? " company name "+GetFileVersion($source_file,"company name") ? " filedescription "+GetFileVersion($source_file,"filedescription") ? " fileversion "+GetFileVersion($source_file,"fileversion") ? " internalname "+GetFileVersion($source_file,"internalname") ? " language "+GetFileVersion($source_file,"language") ? " legalcopyright "+GetFileVersion($source_file,"legalcopyright") ? " legaltrademarks "+GetFileVersion($source_file,"legaltrademarks") ? " originalfilename "+GetFileVersion($source_file,"originalfilename") ? " privatebuild "+GetFileVersion($source_file,"privatebuild") ? " productname "+GetFileVersion($source_file,"productname") ? " productversion "+GetFileVersion($source_file,"productversion") ? " specialbuild "+GetFileVersion($source_file,"specialbuild") ? ENDIF IF (@error <> 0) ? "Warning INSTALL: "+@serror ENDIF $i=$i+1 LOOP ; IF ($debug_mode = "yes") del "c:\"+$kix_files[0] ; - activates an automatic update for debugging script - ENDIF IF(exist("c:\"+$kix_files[0]) <> 1) $update="yes" $i=1 WHILE ($i <= $max_kix_files) $destination_file=$destination_directory+$kix_files[$i] IF (exist($destination_file) <> 1) $update="no" $update_info=$update_info+" unknown_file."+LCASE($kix_files[$i]) ENDIF $i=$i+1 LOOP ENDIF IF ($update = "yes") $update_info="("+LTRIM(RTRIM(LCASE($update_info)))+") to "+'"'+LTRIM(RTRIM(LCASE($destination_directory)))+'"' IF writeprofilestring("c:\"+$kix_files[0], "Kixtart "+$os, "Kixtart @kix", "installation completed at "+@date+" "+@time+" "+$update_info) ENDIF ELSE IF (exist("c:\"+$kix_files[0]) = 1) del "c:\"+$kix_files[0] ENDIF ENDIF ; -------------------------------------------------------------------------- ; - HKCR registry update - ; -------------------------------------------------------------------------- $ikey="HKEY_CLASSES_ROOT\.kix" IF (ExistKey($ikey) = 0) IF (DelTree($ikey) <> 0) ? @serror ENDIF ENDIF $ikey="HKEY_CLASSES_ROOT\.scr" IF (ExistKey($ikey) = 0) IF (DelTree($ikey) <> 0) ? @serror ENDIF ENDIF $ikey="HKEY_CLASSES_ROOT\kix32 document" IF (ExistKey($ikey) = 0) IF (DelTree($ikey) <> 0) ? @serror ENDIF ENDIF ; IF (exist($source_directory+"Kedit.ico") = 1) copy $source_directory+"Kedit.ico" "c:\Kedit.ico" ENDIF IF (exist($source_directory+"kixedit.reg") = 1) shell "%comspec% /e:1024 /c regedit /s "+$source_directory+"kixedit.reg" ENDIF ; -------------------------------------------------------------------------- ; - end - ; -------------------------------------------------------------------------- :end_script $time_stop=@time IF ($update = "yes") $log_info="Kixtart-UPDATE "+$prgrm_version+" script completed successfully" $log_info=$log_info+" ("+$time_start+" - "+$time_stop+") "+LTRIM(RTRIM($update_info)) IF ($debug_mode = "yes") ? ? " logevent = "+$log_info ? ENDIF IF logevent(0, 1, $log_info, "", "Kixtart UPDATE @kix"+"c") ENDIF ENDIF ? "Kixtart "+@kix+" update incompleted. ('"+$source_directory+"' -> '"+$destination_directory+"')" IF (RedirectOutput("CON") = 0) ENDIF :end break on flushkb
Greetings. btw: related kixtart topic http://kixtart.org/board/Forum2/HTML/000583.html
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1013 anonymous users online.
|
|
|