Page 1 of 2 12>
Topic Options
#5001 - 2000-11-10 01:29 PM @KIX on server and on client ?
Anonymous
Unregistered


I would like to use the "KIX" macro to find out if KiXtart needs to be updated.
I can use it in my script to check the local version of KIX but how do I compare this with the version on the server?
I think this is a simple question for you wizzards?
Greetings, eddy

------------------
Eastborn Slaapsytemen BV
Eddy Croezen

Top
#5002 - 2000-11-10 02:34 PM Re: @KIX on server and on client ?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Hoi Eddie,

just a quick one to start the juices flowing:

GetFileVersion returned "3, 63, 0, 0"
You'll have to mangle that string so that it looks like "3.63" that @kix returned

Luck
Jochen

_________________________



Top
#5003 - 2000-11-10 04:19 PM Re: @KIX on server and on client ?
Anonymous
Unregistered


Yoh Jochen,
Almost got it. Now using ;

$temp0= GetFileVersion( "%0\..\kix32.exe", "ProductVersion")
$result= substr($temp0, 1, 1) + "." + substr($temp0, 4 ,2)
If $result <> @KIX
?"update"
else
?"not update"
endif

Still a little problem;
It doesn't reads the fileversion on the server.

So if you can kix me in the right direction once again?
Thanks alot!
eddy

------------------
Eastborn Slaapsytemen BV
Eddy Croezen

Top
#5004 - 2000-11-10 04:25 PM Re: @KIX on server and on client ?
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
how about using getfiletime() between the 2 files, if they don't match, upgrade?

code:

if getfiletime("c:\kix32.exe") <> getfiletime("%0\..\kix32.exe")
;copy files....
endif

Bryce

Top
#5005 - 2000-11-10 04:46 PM Re: @KIX on server and on client ?
Anonymous
Unregistered


Alrightie, but it doesn't retrieve information from the server.

$2=getfiletime("%0\..\kix32.exe")

$2 is empty ????
So with both options it seems to be the same problem.

------------------
Eastborn Slaapsytemen BV
Eddy Croezen

Top
#5006 - 2000-11-10 04:59 PM Re: @KIX on server and on client ?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Eddy,
is Kix32.exe in the same folder as Your LogonScript ?

Bryce : Getfiletime ... excellent
[*and again Jochen didn't saw the forrest for the trees *]
b.t.w : @KIX would return the Version of Kix32.exe used in the batch to run the Script, wouldn't it ? I suspect %0\..\Kix32

[This message has been edited by jpols (edited 10 November 2000).]

[This message has been edited by jpols (edited 10 November 2000).]

_________________________



Top
#5007 - 2000-11-10 05:15 PM Re: @KIX on server and on client ?
Anonymous
Unregistered


Yes the kix32.exe is in my logondirectory
(something like system\repl\import)

$2=getfiletime("%0\..\kix32.exe")

@KIX return the version of the local kix32.exe

------------------
Eastborn Slaapsytemen BV
Eddy Croezen

Top
#5008 - 2000-11-10 05:20 PM Re: @KIX on server and on client ?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
aha ... nice to know !

try it with

$2=getfiletime("@ldrive\kix32.exe")

Jochen

_________________________



Top
#5009 - 2000-11-10 05:48 PM Re: @KIX on server and on client ?
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Eddy,
i have to contradict you :
@kix returned the Version of KIX32.exe (3.62)
i started the Script with , and not the actual in System32 folder (3.63)
_________________________



Top
#5010 - 2000-11-11 09:36 AM Re: @KIX on server and on client ?
Anonymous
Unregistered


Jochen,

Locally in my windows directory i have kix version 3.62
On the server in the netlogon directory is version 3.63

getfiletime("c:\windows\kix32.exe")
returns " 1999/11/24 16:50:01 "

getfiletime("%0\..\kix32.exe")
returns ""

@KIX
returns "3.62"

So the problem is checking the version on the server.

------------------
Eastborn Slaapsytemen BV
Eddy Croezen

[This message has been edited by croezen (edited 11 November 2000).]

Top
#5011 - 2000-11-11 02:58 PM Re: @KIX on server and on client ?
Anonymous
Unregistered


Use of the syntax %0\..\ is discussed in Knowledge Base article Q121387 and when ik read this it explains its use in batchfiles (logon.bat), but ;
Does this work in kix files as well ?

------------------
Eastborn Slaapsytemen BV
Eddy Croezen

Top
#5012 - 2000-11-12 01:35 PM Re: @KIX on server and on client ?
Anonymous
Unregistered


Hi All,

My Trick to do the job:
( It's not really checkin' the version, but just checkin' a key created by the script itself).

code:

$KiXversion = READVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\SysBeh","KiXversion")
IF $KiXversion <> "3,63,0,0"
IF EXIST ($WINDIR + "\BACKUP\Lmscript.exe_old") <> 1
COPY $WINDIR + "\SYSTEM\LMSCRIPT.EXE" $WINDIR + "\BACKUP\Lmscript.exe_old"
ENDIF
COPY @LDRIVE + "Kix32.exe" $WINDIR + "\SYSTEM\Lmscript.exe"
COPY @LDRIVE + "Kx16.dll" $WINDIR + "\SYSTEM\Kx16.dll"
COPY @LDRIVE + "Kx32.dll" $WINDIR + "\SYSTEM\Kx32.dll"
COPY @LDRIVE + "Kx95.dll" $WINDIR + "\SYSTEM\Kx95.dll"
WRITEVALUE("HKEY_LOCAL_MACHINE\SOFTWARE\SysBeh","KiXversion","3,63,0,0","REG_SZ")
ENDIF

Of course the READ- and WRITEVALUE need to be modified every time you update KiX.

Cya,
Wam.

[This message has been edited by Wam (edited 12 November 2000).]

[This message has been edited by Wam (edited 13 November 2000).]

Top
#5013 - 2000-11-13 02:32 PM Re: @KIX on server and on client ?
Anonymous
Unregistered


How about;


:updatekix
$updatekix= CompareFileTimes( %WINDIR%\kix32.exe, @LDRIVE\kix32.exe)
if $updatekix = -3 or $updatekix = -2
messagebox("Error @Error","",64)
endif
if $updatekix = -1
messagebox("Local Kix version needs updating","",64)
COPY "@LDRIVE\Kix32.exe" "%WINDIR%\kix32.exe"
if @Error <> 0
messagebox("Error @Error","",64)
sleep 15
endif
COPY "@LDRIVE\kx16.dll" "%WINDIR%\kx16.dll"
COPY "@LDRIVE\kx32.dll" "%WINDIR%\kx32.dll"
COPY "@LDRIVE\kx95.dll" "%WINDIR%\kx95.dll"
endif
if $updatekix = 0
messagebox("Kix version is OK","",64)
endif
if $updatekix = 1
messagebox("Kix version is newer then Serverversion!!!!","",64)
if @FULLNAME = "Eddy Croezen"
messagebox("Serverversion of Kix is beeing updated","",64)
else
messagebox("What the xxx are you doing with this new kix version","",64)
endif
endif
return

The problem with this solution is that I get an error 32!! Because Kix32.exe is in use ?

------------------
Eastborn Slaapsytemen BV * Eddy Croezen

Top
#5014 - 2000-11-13 03:36 PM Re: @KIX on server and on client ?
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
If all you are wanting to do is make sure that the current version of kix is installed on the local client.....you might want to do this from the same batch file that launches your logon script and use the xcopy command.

code:

@Echo Off

CLS
ECHO Verifying / Updating Script Software Installation, Please Wait...

IF "%OS%" == "Windows_NT" GOTO WinNT

%windir%\command\XCOPY %0\..\KIX32.EXE %WINDIR%\SYSTEM\ /D /H /I /R /V > NUL
%windir%\command\XCOPY %0\..\KX16.DLL %WINDIR%\SYSTEM\ /D /H /I /R /V > NUL
%windir%\command\XCOPY %0\..\KX32.DLL %WINDIR%\SYSTEM\ /D /H /I /R /V > NUL
%windir%\command\XCOPY %0\..\KX95.DLL %WINDIR%\SYSTEM\ /D /H /I /R /V > NUL
ECHO Loading Logon Script, Please Wait...
%windir%\system\kix32.exe %0\..\logon.kix
GOTO End

:WinNT
XCOPY %0\..\KIX32.EXE %WINDIR%\SYSTEM32\ /D /H /I /R /V > NUL
ECHO Loading Logon Script, Please Wait...
%WINDIR%\SYSTEM32\KIX32.EXE %0\..\logon.KIX
GOTO end

:End


Bryce

Top
#5015 - 2000-11-14 09:45 AM Re: @KIX on server and on client ?
Anonymous
Unregistered


Thanks a lot Bryce, that seems to be te best solution!

------------------
Eastborn Slaapsytemen BV * Eddy Croezen

Top
#5016 - 2000-11-26 09:54 PM Re: @KIX on server and on client ?
Anonymous
Unregistered


Bryce,

That last batch file you show works great!

I was wondering if there is a way to do an "IF" statement in the BATCH file to determine if the files already exist so you could bypass the copying of the files. I don’t really want to copy them unless they aren’t there for some reason.

Or maybe a way to check the version and copy them if the version on the workstation is older than what is on the server (from within the BATCH file)? Of course you guys have been discussing this above. But that is from within a kix file. I would like to do it from the batch file so that it would be updated before it runs the kix logon script.

Thanks,
Pete

[This message has been edited by PCC (edited 26 November 2000).]

Top
#5017 - 2000-11-27 04:16 PM Re: @KIX on server and on client ?
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
That is covered by one of the many switches on the end of the xcopy command..... the /d option does this.

/D:m-d-y Copies files changed on or after the specified date.
If no date is given, copies only those files whose
source time is newer than the destination time.

Bryce

Top
#5018 - 2000-11-28 04:29 PM Re: @KIX on server and on client ?
Anonymous
Unregistered


That's what I thought...but it doesn't seem to be working that way. It copies the files every time the batch file is run.

Any ideas why it would be doing this?

Thanks,
Pete

Top
#5019 - 2000-11-28 04:33 PM Re: @KIX on server and on client ?
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
hmmm...

does it do this on all of your clients?

what is the OS of the clients?

Could you do a "xcopy /?" and cut-n-paste the output here.

Bryce

Top
#5020 - 2000-11-28 07:02 PM Re: @KIX on server and on client ?
Anonymous
Unregistered


It appears that it is only doing this on my Win9x clients. But here is the printout.

Copies files and directory trees.

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W]
[/C] [/I] [/Q] [/F] [/L] [/H] [/R] [/T] [/U]
[/K] [/N] [/Z]

source Specifies the file(s) to copy.
destination Specifies the location and/or name of new files.
/A Copies files with the archive attribute set,
doesn't change the attribute.
/M Copies files with the archive attribute set,
turns off the archive attribute.
/D:m-d-y Copies files changed on or after the specified date.
If no date is given, copies only those files whose
source time is newer than the destination time.
/P Prompts you before creating each destination file.
/S Copies directories and subdirectories except empty ones.
/E Copies directories and subdirectories, including empty ones.
Same as /S /E. May be used to modify /T.
/V Verifies each new file.
/W Prompts you to press a key before copying.
/C Continues copying even if errors occur.
/I If destination does not exist and copying more than one file,
assumes that destination must be a directory.
/Q Does not display file names while copying.
/F Displays full source and destination file names while copying.
/L Displays files that would be copied.
/H Copies hidden and system files also.
/R Overwrites read-only files.
/T Creates directory structure, but does not copy files. Does not
include empty directories or subdirectories. /T /E includes
empty directories and subdirectories.
/U Copies only files that already exist in destination.
/K Copies attributes. Normal Xcopy will reset read-only attributes.
/N Copies using the generated short names.
/Z Copies networked files in restartable mode.

Thanks,
Pete

Top
Page 1 of 2 12>


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 664 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.064 seconds in which 0.023 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org