IF setconsole("hide") ENDIF ; ; NT/95 install kixtart - Kixtart 3.62, 3.63, 4.00 ; ; (c) scripting@wanadoo.nl - 2000, 2001 ; ; vs 2.04 - 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. ; 2.01 (20010401) - kixtart 2001 beta1 compliancy ; - kix32.exe (= console-less version) ; - kix32c.exe (= console version) ; - introduction of "$debug_file" ; - introduction of "$update_ok". all kixtart files ; must be available at "$destination_directory". ; - check files ; - kix400.kix <= kix32.exe ; - kix400c.kix <= kix32c.exe (with "kix.console" file) ; - introduction of "$kix_console_mode". ; - additional information written to eventlog. ; 2.02 (20010605) - split script for with/without debugging. ; - activate $debug_mode when variable %kix-debug% is declared. ; - shows also @curdir value. ; - fix: for too late flushing write-buffers on windows95 ; 2.03 (20010710) - standardization of $debug_file value ; 2.04 (20011120) - add "windows XP" ; $prgrm_version="2.04" ; $tmp_directory=ExpandEnvironmentVars("%tmp%") IF (substr($tmp_directory,len($tmp_directory),1) <> "\") $tmp_directory=$tmp_directory+"\" ENDIF ; $debug_mode="no" IF (len(ExpandEnvironmentVars(CHR(37)+"kix-debug"+CHR(37))) <> 0) $debug_mode="yes" ENDIF ; --------------------------------------------------------------------------- ; - site defined settings - ; --------------------------------------------------------------------------- $debug_file=$tmp_directory+"kix-info.log" ; --------------------------------------------------------------------------- ; - - ; --------------------------------------------------------------------------- IF (@inwin = 1) $NT_mode="yes" ELSE $NT_mode="no" ENDIF ; $os="" $os_dos=@dos SELECT CASE ($NT_mode = "yes") AND ($os_dos = "5.1") ; - Windows XP - $os="XP" CASE ($NT_mode = "yes") AND ($os_dos = "5.0") ; - Windows 2000 - $os="W2K" CASE ($NT_mode = "yes") ; - Windows NT - $os="NT4" CASE ($NT_mode <> "yes") AND ($os_dos = "4.90") ; - Windows ME - $os="ME" CASE ($NT_mode <> "yes") AND ($os_dos = "4.10") ; - Windows 98 - $os="W98" CASE ($NT_mode <> "yes") AND ($os_dos = "4.0") ; - Windows 95 - $os="W95" CASE 1 $os="???" ; - undetermined - ENDSELECT $time_start=@time ; IF ($debug_mode = "yes") break on del $debug_file IF (RedirectOutput($debug_file,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 $debug_file 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" - ; - "if not exist c:\kix400.ok %0\..\kix400update.exe /q" - ; - "if not exist c:\kix400c.ok %0\..\kix400update.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 ; $kix_console_mode="no" IF (exist($source_directory+"kix.console") = 1) $kix_console_mode="yes" 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 - IF ($kix_console_mode = "yes") $kix_files[0]="kix"+substr(@kix,1,1)+substr(@kix,3,2)+"c.ok" ; - check file (console) - ENDIF $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") OR ($debug_mode = "yes") copy $source_file $destination_file /H $update_info=$update_info+" +"+LCASE($kix_files[$i]) ELSE $update_info=$update_info+" ="+LCASE($kix_files[$i]) ENDIF IF (@error <> 0) ? "Warning INSTALL "+@error+": "+@serror 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 $i=$i+1 LOOP ; IF ($debug_mode = "yes") del "c:\"+$kix_files[0] ; - activates an automatic update for debugging script - ENDIF ; $update_ok="yes" ; - all kixtart files must be available at $destination_directory - $i=1 WHILE ($i <= $max_kix_files) $destination_file=$destination_directory+$kix_files[$i] IF (exist($destination_file) <> 1) $update_ok="no" $update_info=$update_info+" unknown_file."+LCASE($kix_files[$i]) IF writeprofilestring("c:\"+$kix_files[0], "Kixtart "+$os, LCASE($kix_files[$i])+" "+@kix, @date+" "+@time+" -> unknown file") ENDIF ELSE IF writeprofilestring("c:\"+$kix_files[0], "Kixtart "+$os, LCASE($kix_files[$i])+" "+@kix, @date+" "+@time+" -> "+GetFileTime($destination_file)+" "+GetFileSize($destination_file)) ENDIF ENDIF $i=$i+1 LOOP IF ($update_ok = "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 $update_info="("+LTRIM(RTRIM(LCASE($update_info)))+") to "+'"'+LTRIM(RTRIM(LCASE($destination_directory)))+'"' IF writeprofilestring("c:\"+$kix_files[0], "Kixtart "+$os, "Kixtart "+@kix, "installation incompleted at "+@date+" "+@time+" "+$update_info) ENDIF ENDIF IF ($update_ok <> "yes") IF (exist("c:\"+$kix_files[0]) = 1) IF ($debug_mode <> "yes") del "c:\"+$kix_files[0] ; - kixtart version is incompleted - ENDIF ENDIF ENDIF ; -------------------------------------------------------------------------- ; - HKCR registry update - ; -------------------------------------------------------------------------- $ikey="HKEY_CLASSES_ROOT\.kix" IF (ExistKey($ikey) = 0) IF (DelTree($ikey) <> 0) ? "Warning INSTALL.KIX "+@error+": "+@serror ENDIF ENDIF $ikey="HKEY_CLASSES_ROOT\.scr" IF (ExistKey($ikey) = 0) IF (DelTree($ikey) <> 0) ? "Warning INSTALL.KIX "+@error+": "+@serror ENDIF ENDIF $ikey="HKEY_CLASSES_ROOT\kix32 document" IF (ExistKey($ikey) = 0) IF (DelTree($ikey) <> 0) ? "Warning INSTALL.KIX "+@error+": "+@serror ENDIF ENDIF ; IF (exist($source_directory+"Kedit.ico") = 1) copy $source_directory+"Kedit.ico" "c:\Kedit.ico" /H ENDIF IF (exist($source_directory+"kixedit.reg") = 1) ? "Informative INSTALL.KIX: creation of KIX file associations." shell "%comspec% /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 ($console_mode = "yes") $log_info=$log_info+" (CONSOLE)" ENDIF IF ($debug_mode = "yes") ? ? " logevent = "+$log_info ? ENDIF IF ($update_ok = "yes") IF logevent(0, 1, $log_info, "", "Kixtart UPDATE @kix"+"c") ENDIF ELSE IF logevent(0, 1, $log_info, "", "Kixtart UPDATE @kix"+"e") ENDIF ENDIF ENDIF IF ($update_ok = "yes") $update_ok="" ELSE $update_ok="in" ENDIF IF ($kix_console_mode = "yes") ? "Kixtart "+@kix+" (console) update "+$update_ok+"completed. ('"+$source_directory+"' -> '"+$destination_directory+"')" ELSE ? "Kixtart "+@kix+" update "+$update_ok+"completed. ('"+$source_directory+"' -> '"+$destination_directory+"')" ENDIF IF (RedirectOutput("CON") = 0) ENDIF IF ($kix_console_mode = "yes") ? "Kixtart "+@kix+" (console) update "+$update_ok+"completed. ('"+$source_directory+"' -> '"+$destination_directory+"')" ELSE ? "Kixtart "+@kix+" update "+$update_ok+"completed. ('"+$source_directory+"' -> '"+$destination_directory+"')" ENDIF ? IF ($debug_mode = "yes") ? "Informative INSTALL: create debug list '"+$debug_file+"'" ELSE ? "Informative INSTALL: no creation of debug list '"+$debug_file+"'" ENDIF :end break on flushkb