Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
I would imagine with Lonkero and his "Script Magic" could clean this up even more..
But, here it is in a pretty good distilled down state..
It does seem to "bomb" if you remove the quotes from the following: code:
IF @inwin=1 $max='1' ELSE $max='4' ENDIF
{Edit} Never mind.. Me and those DIM Statements.. {/Edit}
Anyway, here is the code at this point.. code:
DIM $max,$kixfl[$max+1] $pgmvrs='3.10' $tmp=ExpandEnvironmentVars('%tmp%'+'\') $srcdir=@curdir+'\' $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 IF @inwin=1 $max=1 ELSE $max=4 ENDIF ;DIM $kixfl[$max+1] $kixfl[0]='kix'+$message+'.ok' $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 IF Exist($destdir+$kixfl[0]) $firstinst='no' ELSE DEL $destdir+'kix*.ok' 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+' +'+$kixfl[$i] ELSE $updinfo=$updinfo+' ='+$kixfl[$i] ENDIF $i=$i+1 LOOP $upok='yes' $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) $upok='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 WHILE $i<=$max $destfil=$destdir+$kixfl[$i] IF Exist($destfil) $rc=SetFileAttr($destfil,128)<>0 DEL $destfil $updinfo=$updinfo+' ?'+$kixfl[$i] ELSE $updinfo=$updinfo+' ?'+$kixfl[$i] ENDIF $i=$i+1 LOOP ENDIF IF $upok='yes' $state='install complete at ' $info=$state+@date+' '+@time+' '+$updinfo ELSE $state='install incomplete at ' $info='update'+$message IF Exist($sysdrv+$kixfl[0]) DEL $sysdrv+$kixfl[0] ENDIF IF Exist($destdir+$kixfl[0]) $destdir+$kixfl[0] ENDIF ENDIF $rc=WriteProfileString($sfl,'KiX','KiX release',@producttype+' -> kix '+@kix) $rc=WriteProfileString($dfl,'KiX','KiX release',@producttype+' -> kix '+@kix) $updinfo='('+Trim($updinfo)+') to '+'"'+Trim($destdir)+'"' $rc=WriteProfileString($sfl,'KiX','KiX',$info) $rc=WriteProfileString($dfl,'KiX','KiX',$info)
Thanks,
Kent [ 24. April 2003, 18:05: Message edited by: kdyer ]
|