Doing a re-write of the KiX421Update.exe from MCA (again). [Smile]

This is using the IExpress packager..

Done some distallation and consolidation of the code.. Also, trimmed down some of the long lines and removed uneeded parenthesis, spaces, etc.

However, when I run the update it generates the following in the Event Log as is directed by the script:
quote:

Event Type: None
Event Source: Kixtart UPDATE 4.21 Release Candidate 2c
Event Category: None
Event ID: 1
Date: 4/23/2003
Time: 8:31:25 AM
User: N/A
Computer: MACHINEID
Description:
The description for Event ID ( 1 ) in Source ( Kixtart UPDATE 4.21 Release Candidate 2c ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: Kixtart-UPDATE 3.08 script completed successfully (08:31:25 - 08:31:25) (+kix421.ok +kix32.exe) to "c:\scripts\".

Now, if we look through this, we see that the code properly deploys KIX32.EXE and creates the Marker files .OK to the C:\ and to C:\Scripts to my NT-Classed system. Does this mean we can just simply ignore this?

Here is the modified INSTALL.KIX code:
code:
 $prgrm_version='2.00'
$sysdrv=SUBSTR('%WINDIR%',1,3)
$destdir=$sysdrv+'Scripts'
$message=Substr(@kix,1,1)+Substr(@kix,3,2)
IF 0=EXIST($destdir)
MD $destdir
ELSE
$destdir=$destdir+'\'
ENDIF
IF len($destdir)=0
$destdir=@lanroot+'\'
ENDIF

$pgmvrs='3.08'
$tmp=ExpandEnvironmentVars('%tmp%'+'\')

$timest=@time
$srcdir=@curdir+'\'

;$consolemode='no' ; - kix32.exe -
IF @inwin=1
$max=1
ELSE
$max=4
ENDIF
DIM $kixfl[$max+1]
$kixfl[0]='kix'+$message+'.ok' ; - check file -
$kixfl[1]='kix32.exe'
$kixfl[2]='kx16.dll'
$kixfl[3]='kx32.dll'
$kixfl[4]='kx95.dll'
$firstinst='yes'
IF Exist($sysdrv+$kixfl[0]) DEL $sysdrv+'\kix*.ok' ENDIF
; - other installed kixtart versions removing always -
IF Exist($destdir+$kixfl[0])
$firstinst='no'
ELSE
DEL $destdir+'kix*.ok' ; - other installed kixtart versions -
ENDIF
$update='no'
$updinfo=''
$i=0
WHILE $i<=$max
$srcfl=$srcdir+$kixfl[$i]
$destfil=$destdir+$kixfl[$i]
IF Exist($destfil) $rc=SetFileAttr($destfil,128)<>0 ENDIF
$update='yes'
IF Exist($srcfl)
$update='no'
$srcflsz=GetFileSize($srcfl)
$desflsz=GetFileSize($destfil)
$srcfltm=GetFileTime($srcfl)
$desfltm=GetFileTime($destfil)
$srcfld=GetFileVersion($srcfl,'filedescription')
$desfld=GetFileVersion($destfil,'filedescription')
$srcflv=GetFileVersion($srcfl,'fileversion')
$desflv=GetFileVersion($destfil,'fileversion')
$srcfli=GetFileVersion($srcfl,'internalname')
$desfli=GetFileVersion($destfil,'internalname')
$srcfll=GetFileVersion($srcfl,'language')
$desfll=GetFileVersion($destfil,'language')
$srcflo=GetFileVersion($srcfl,'originalfilename')
$desflo=GetFileVersion($destfil,'originalfilename')
$srcflp=GetFileVersion($srcfl,'productname')
$desflp=GetFileVersion($destfil,'productname')

IF $srcflsz<>$desflsz $update='yes' ENDIF
IF $srcfltm<>$desfltm $update='yes' ENDIF
IF $srcfld<>$desfld $update='yes' ENDIF
IF $srcflv<>$desflv $update='yes' ENDIF
IF $srcfli<>$desfli $update='yes' ENDIF
IF $srcfll<>$desfll $update='yes' ENDIF
IF $srcflo<>$desflo $update='yes' ENDIF
IF $srcflp<>$desflp $update='yes' ENDIF
ENDIF
IF $update='yes'
COPY $srcfl $destfil /h
$updinfo=$updinfo+' +'+Lcase($kixfl[$i])
ELSE
$updinfo=$updinfo+' ='+Lcase($kixfl[$i])
ENDIF
IF @error<>0 ? 'Warning INSTALL: error '+@error+' ('+@serror+')' ENDIF
$i=$i+1
LOOP
$updateok='yes' ; - all kixtart files must be available at $destdir -
$i=1
$sfl=$sysdrv+$kixfl[0]
$dfl=$destdir+$kixfl[0]
WHILE $i<=$max
$destfil=$destdir+$kixfl[$i]
$dfltm=GetFileTime($destfil)
$dflsz=GetFileSize($destfil)
IF 0=Exist($destfil)
$updateok='no'
$updinfo=$updinfo+' unknown_file.'+$kixfl[$i]
$rc=WriteProfileString($sfl,'KiX',$kixfl[$i],@date+' '+@time+' -> unknown file')
$rc=WriteProfileString($dfl,'KiX',$kixfl[$i],@date+' '+@time+' -> unknown file')
ELSE
$buildinfo=GetFileVersion($destfil,'specialbuild')
IF Len($buildinfo)>0
$buildinfo=' ('+Lcase($buildinfo)+')'
ELSE
$buildinfo=''
ENDIF
$rc=WriteProfileString($sfl,'KiX',$kixfl[$i],@date+' '+@time+' -> '+$dfltm+' '+$dflsz+$buildinfo)
$rc=WriteProfileString($dfl,'KiX',$kixfl[$i],@date+' '+@time+' -> '+$dfltm+' '+$dflsz+$buildinfo)
ENDIF
$i=$i+1
IF @inwin=1 $i=$max+1 ENDIF
LOOP
$i=$max
IF 2=@inwin
$max=4
$i=2 ; - remove DLL's -
WHILE $i<=$max
$destfil=$destdir+$kixfl[$i]
IF Exist($destfil)
$rc=SetFileAttr($destfil,128)<>0
DEL $destfil
$updinfo=$updinfo+' ?'+Lcase($kixfl[$i])
ELSE
$updinfo=$updinfo+' ?'+Lcase($kixfl[$i])
ENDIF
$i=$i+1
LOOP
ENDIF
;$sysdrv+$kixfl[0]
IF $updateok='yes'
$updinfo='('+Ltrim(Rtrim(Lcase($updinfo)))+') to '+'"'+Ltrim(Rtrim(Lcase($destdir)))+'"'
$rc=WriteProfileString($sfl,'KiX','KiX','install complete at '+@date+' '+@time+' '+$updinfo)
$rc=WriteProfileString($dfl,'KiX','KiX','install complete at '+@date+' '+@time+' '+$updinfo)
ELSE
$updinfo='('+Ltrim(Rtrim(Lcase($updinfo)))+') to '+'"'+Ltrim(Rtrim(Lcase($destdir)))+'"'
$rc=WriteProfileString($sfl,'KiX','KiX','install incomplete at '+@date+' '+@time+' '+$updinfo)
$rc=WriteProfileString($dfl,'KiX','KiX','install incomplete at '+@date+' '+@time+' '+$updinfo)
ENDIF
IF $updateok<>'yes'
IF Exist($sysdrv+$kixfl[0]) DEL $sysdrv+$kixfl[0] ENDIF
; - kixtart version is incompleted -
IF Exist($destdir+$kixfl[0]) $destdir+$kixfl[0] ENDIF
; - kixtart version is incompleted -
$rc=WriteProfileString($sfl,'KiX','KiX release',@PRODUCTTYPE+' -> kix '+@kix)
$rc=WriteProfileString($dfl,'KiX','KiX release',@PRODUCTTYPE+' -> kix '+@kix)
$rc=WriteProfileString($sfl,'KiX','KiX mode','update'+$message)
$rc=WriteProfileString($dfl,'KiX','KiX mode','update'+$message)
ENDIF
:end_script
$timestop=@time
IF $update='yes'
$loginfo='Kixtart-UPDATE '+$pgmvrs+' script completed successfully'
$loginfo=$loginfo+' ('+$timest+' - '+$timestop+') '+Ltrim(Rtrim($updinfo))
IF $consolemode='yes' $loginfo=$loginfo+' (CONSOLE-LESS)' ENDIF
IF $updateok='yes'
$rc=LogEvent(0,1,$loginfo,'','Kixtart UPDATE @kix'+'c')
ELSE
$rc=LogEvent(0,1,$loginfo,'','Kixtart UPDATE @kix'+'e')
ENDIF
ENDIF
IF $updateok='yes'
$updateok=''
ELSE
$updateok='in'
ENDIF
IF $consolemode='yes'
? 'KiX '+@kix+' (console-less) update '+$updateok+'complete. (''+$srcdir+'' -> ''+$destdir+'')'
ELSE
? 'KiX '+@kix+' update '+$updateok+'complete. (''+$srcdir+'' -> ''+$destdir+'')'
ENDIF
IF RedirectOutput('CON')=0 ENDIF
IF $consolemode='yes'
? 'KiX '+@kix+' (console-less) update '+$updateok+'complete. ("'+$srcdir+"' -> '"+$destdir+'")'
ELSE
? 'KiX '+@kix+' update '+$updateok+'completed. ("'+$srcdir+'" -> "'+$destdir+'")'
ENDIF
?
? 'Informative INSTALL: no creation of debug list ''+$debug_file+'''
:end
IF $showmode='yes'
$title='KiXtart '+@kix
IF $firstinst='yes'
IF Exist($sysdrv+'kix'+$message+'.ok') OR Exist($destdir+'kix'+$message+'.ok')
$message='Install of KiX '+@kix+' complete'
ELSE
$message='Install of KiX '+@kix+' incomple'
ENDIF
ELSE
IF Exist($sysdrv+'kix'+$message+'.ok') OR Exist($destdir+'kix'+$message+'.ok')
$message='Install of KiX '+@kix+' complete'
ELSE
$message='Install of KiX '+@kix+' incomplete'
ENDIF
ENDIF
ENDIF
BREAK ON
FLUSHKB
IF Exist($sysdrv+'kix'+$message+'.ok') OR Exist($destdir+'kix'+$message+'.ok')
EXIT(0)
ELSE
EXIT(1)
ENDIF

Thanks for any feedback/updates to this.

Kent

[ 24. April 2003, 14:24: Message edited by: kdyer ]
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's