code:
IF setconsole("hide")
ENDIF
;
; NT/95 logon - Kixtart 3.62
;
; (c) scripting@wanadoo.nl - 2000
;
; vs 1.02 - 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.
;
$prgrm_version="1.02"
;
$debug_mode="no" ; - yes/no -
IF (exist("c:\temp\kixtart.dbg") = 1)
$debug_mode="yes"
ENDIF
IF (@inwin = 1)
$NT_mode="yes"
ELSE
$NT_mode="no"
ENDIF
$time_start=@time
;
IF ($debug_mode = "yes")
break on
del "c:\temp\kixtart.dbg"
del "c:\temp\kixtart.txt"
IF (RedirectOutput("c:\temp\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 "c:\temp\kixtart.dbg"
del "c:\temp\kixtart.txt"
IF (RedirectOutput("nul",1) = 0)
ENDIF
ENDIF IF ($debug_mode = "yes")
IF ($NT_mode = "yes")
? "Kixtar "+@kix+" - NT debug mode (vs "+$prgrm_version+")"+" "+$time_start
ELSE
? "Kixtar "+@kix+" - 95 debug mode (vs "+$prgrm_version+")"+" "+$time_start
ENDIF
?
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" -
; --------------------------------------------------------------------------
$source_directory="c:\temp\ixp000.tmp\"
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]="kix362.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 ($NT_mode = "yes" )
IF writeprofilestring("c:\"+$kix_files[0], "Kixtart NT", "Kixtart @kix", "installation completed at "+@date+" "+@time+" "+$update_info)
ENDIF
ELSE
IF writeprofilestring("c:\"+$kix_files[0], "Kixtart 9x", "Kixtart @kix", "installation completed at "+@date+" "+@time+" "+$update_info)
ENDIF
ENDIF
ELSE
IF (exist("c:\"+$kix_files[0]) = 1)
del "c:\"+$kix_files[0]
ENDIF
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
IF ($update = "yes")
? "Kixtart "+@kix+" update completed."
ELSE
? "Kixtart "+@kix+" update incompleted. ('"+$source_directory+"' -> '"+$destination_directory+"')"
ENDIF
IF (RedirectOutput("CON") = 0)
ENDIF
:end
break on
flushkb
Greetings.