Dear,An usefull task is the installation of kixtart files at your local
workstation. Normally you can use a batch procedure to do it.
Possible problems are:
- a lot of code is necessary in your normal kixtart calling batch procedure.
solution:
- create a IExpress file with a control file (f.e. "c:\kix362.ok").
- change code to one single line:
if not exist c:\kix362.ok %0\..\kix362update.exe /q
- batch procedure can't check on file attributes and can't reset it.
solution:
- use kixtart command setfileattr($file, 128)
- batch procedure can't check on file size, time and version
solution:
- use kixtart commands GetFileSize, GetFileTime and GetFileVersion.
- destination folder/directory isn't correct, because windows isn't
installed with general settings.
solution:
- use kixtart commands ReadValue
NT -> ReadValue("HKEY_LOCAL_MACHINE\software\microsoft\windows NT\currentversion", "SystemRoot")
9x -> ReadValue("HKEY_LOCAL_MACHINE\software\microsoft\windows\currentversion", "SystemRoot")
Other capabilities with a kixtart scripts are:
- each individual file can be changed.
- additional debug information about files.
- additional information can be written to eventvwr log.
A batch procedure looks like:
code:
@echo off
cls
@echo installation of Kix 3.62
@echo.
if exist c:\kix362.ok goto server
if exist c:\winnt\kix362.ok goto server
if exist c:\windows\kix362.ok goto server
if exist c:\windows\nul goto w95-kix
:nt-kix
if exist c:\winnt\kx95.dll del c:\winnt\kx95.dll
if exist c:\winnt\kx16.dll del c:\winnt\kx16.dll
if exist c:\winnt\kx32.dll del c:\winnt\kx32.dll
if exist c:\winnt\system32\kx95.dll del c:\winnt\system32\kx95.dll
if exist c:\winnt\system32\kx16.dll del c:\winnt\system32\kx16.dll
if exist c:\winnt\system32\kx32.dll del c:\winnt\system32\kx32.dll
copy %temp%\ixp000.tmp\k*.exe c:\winnt\.
copy %temp%\ixp000.tmp\k*.dll c:\winnt\.
@echo Informative Kixtart: installation completed >c:\winnt\kix362.ok
goto server
:w95-kix
if exist c:\windows\kx95.dll del c:\windows\kx95.dll
if exist c:\windows\kx16.dll del c:\windows\kx16.dll
if exist c:\windows\kx32.dll del c:\windows\kx32.dll
if exist c:\windows\system\kx95.dll del c:\windows\system\kx95.dll
if exist c:\windows\system\kx16.dll del c:\windows\system\kx16.dll
if exist c:\windows\system\kx32.dll del c:\windows\system\kx32.dll
copy %temp%\ixp000.tmp\k*.exe c:\windows\.
copy %temp%\ixp000.tmp\k*.dll c:\windows\.
@echo Informative Kixtart: installation completed >c:\windows\kix362.ok
:server
@echo.
@echo completed.
@echo off
The kixtart script looks like:
code:
IF setconsole("hide")
ENDIF
;
; NT/95 logon - Kixtart 3.62
;
; (c) scripting@wanadoo.nl - 2000
;
; vs 1.00 - program
;
; 1.00 (20000715) original version. created for IExpress package.
; 1.01 (20000715) - additional information written to check-file.
;
$prgrm_version="1.01"
;
$debug_mode="no" ; - yes/no -
IF (@inwin = 1)
$NT_mode="yes"
ELSE
$NT_mode="no"
ENDIF
$time_start=@time
;
IF ($debug_mode = "yes")
break on
IF (RedirectOutput("c:\temp\kixtart.txt",1) = 0)
ENDIF
ELSE
break off
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=@curdir ; - "%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(exist("c:\"+$kix_files[0]) <> 1)
$update="yes"
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
ENDIF
; --------------------------------------------------------------------------
; - end -
; --------------------------------------------------------------------------
:end_script
$time_stop=@time
$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 ($update = "yes")
IF logevent(0, 1, $log_info, "", "Kixtart UPDATE @kix"+"c")
ENDIF
IF (RedirectOutput("CON") = 0)
ENDIF
? "Kixtart "+@kix+" update completed."
ENDIF
:end
break on
flushkb
Batch command for updating kixtart files by using IExpress package:
code:
@echo off
if not exist c:\kix362.ok %0\..\kix362update.exe /q"
@echo off
Control files looks like:
code:
[Kixtart NT]
Kixtart 3.62=installation completed at 2000/07/15 17:31:17 (kix32.exe kx16.dll kx32.dll kx95.dll) to "c:\winnt\"
code:
[Kixtart 9x]
Kixtart 3.62=installation completed at 2000/07/15 17:20:03 (kix32.exe kx16.dll kx32.dll kx95.dll) to "c:\windows\"
The debug file looks like:
code:
Kixtar 3.62 - NT debug mode (vs 1.01) 17:31:14Informative INSTALL: copy v:\temp\ixp000.tmp\kix32.exe c:\winnt\kix32.exe
size.old = 163840
size.new = 163840
time.old = 1999/11/25 00:00:00
time.new = 1999/11/25 00:00:00
company name
filedescription KiXtart main executable
fileversion 3, 62, 0, 0
internalname KIX32
language 0409English
legalcopyright Copyright Microsoft Corp. 1999
legaltrademarks
originalfilename KIX32.EXE
privatebuild
productname KiXtart
productversion 3, 62, 0, 0
specialbuild
Informative INSTALL: copy v:\temp\ixp000.tmp\kx16.dll c:\winnt\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 v:\temp\ixp000.tmp\kx32.dll c:\winnt\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 v:\temp\ixp000.tmp\kx95.dll c:\winnt\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 1.01 script completed successfully (17:31:14 - 17:31:17) (kix32.exe kx16.dll kx32.dll kx95.dll) to "c:\winnt\"
By entering http://home.wanadoo.nl/scripting/index.htm you can download
the scripts and IExpress package file of Kixtart 3.62.
Greetings.
BTW: the IExpress SED file of kix362update.exe
code:
[Version]
Class=IEXPRESS
SEDVersion=3
[Options]
PackagePurpose=InstallApp
ShowInstallProgramWindow=1
HideExtractAnimation=1
UseLongFileName=0
InsideCompressed=0
CAB_FixedSize=0
CAB_ResvCodeSigning=0
RebootMode=N
InstallPrompt=%InstallPrompt%
DisplayLicense=%DisplayLicense%
FinishMessage=%FinishMessage%
TargetName=%TargetName%
FriendlyName=%FriendlyName%
AppLaunched=%AppLaunched%
PostInstallCmd=%PostInstallCmd%
AdminQuietInstCmd=%AdminQuietInstCmd%
UserQuietInstCmd=%UserQuietInstCmd%
SourceFiles=SourceFiles
[Strings]
InstallPrompt=
DisplayLicense=
FinishMessage=
TargetName=V:\kix362update.exe
FriendlyName=Kixtart 3.62 installation at local workstation
AppLaunched=Kix32.exe
PostInstallCmd=Kix32.exe install.kix
AdminQuietInstCmd=
UserQuietInstCmd=
FILE0="Install.kix"
FILE1="Kix32.exe"
FILE2="Kx16.dll"
FILE3="Kx32.dll"
FILE4="Kx95.dll"
[SourceFiles]
SourceFiles0=V:\
[SourceFiles0]
%FILE0%=
%FILE1%=
%FILE2%=
%FILE3%=
%FILE4%=
[This message has been edited by MCA (edited 15 July 2000).]
[This message has been edited by MCA (edited 16 July 2000).]