Page 1 of 1 1
Topic Options
#72757 - 2003-01-28 06:17 PM SETM problem in 4.12?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
Hi!

I have a script that we run on every server to createt/alter three SYSTEM environment variables. This has been working for almost 2 years.

Last week, I replaced the 4.01 version of Kix with 4.12 and the script now fails to perform correctly. The changes to the variables are now in the USER section. I'm still using the SETM command.

Ran a test this morning:

? "@KIX" ?
SET "T1=one"
SETL "T2=two"
SETM "T3=three"

When running using v4.01 (confirmed by the @KIX), it properly places T1 in the USER env, T2 in the running env, and T3 in the SYSTEM env. (also confirmed by looking in RegEdit). When running the same script with V4.12, it places both T1 and T3 in the USER env, and nothing in the System env.

Is this a known bug, or have I missed something in the new release?

Thanks!

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#72758 - 2003-01-28 06:29 PM Re: SETM problem in 4.12?
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
Version 4.20 corrects some problems with set maybe it might help.
_________________________
Jack

Top
#72759 - 2003-01-28 08:14 PM Re: SETM problem in 4.12?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
Thanks, but I D/L'd 4.20rc2 today and just tried it - same results.

Seems odd that it hasn't been mentioned here before.

It's a real problem for us, because when you combine the User PATH and System PATH values, it appears to truncate some of the data as a result.

We're going to stay at 4.01 for now, and possibly re-write the code to do direct registry manipulation to define the settings, although programatically, this isn't as clear.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#72760 - 2003-01-28 08:26 PM Re: SETM problem in 4.12?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Did you test form outside the KiXtart process? SETM results are not reflected in the current KiXtart process/environment (see KiXtart Manual!)
_________________________
There are two types of vessels, submarines and targets.

Top
#72761 - 2003-01-28 08:34 PM Re: SETM problem in 4.12?
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
As you can note from here:

http://www.scriptlogic.com/KiXtart/DevReport.asp

Ver4.12 contained several changes to the various SET commands but Rudd's notes seemed to indicate that he fixed known bugs. We don't use environment variables at all so this is not something we use or test a lot. Perhaps Jens or Les might be able to offer other possibilities.

Jens' point is that at any one time there are various environments open & which one you choose to test within can change the apparent results.

[ 28. January 2003, 20:39: Message edited by: Jack Lothian ]
_________________________
Jack

Top
#72762 - 2003-01-28 09:29 PM Re: SETM problem in 4.12?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
I tested all three variants of the SET commands (SET, SETL, and SETM) just to confirm the results. All but SETM work as expected with the newer releases.

Not shown in my example above was the statement:
shell "cmd.exe /c set > /temp/test.txt"
which dumped the Kix current environment. As expected, it had the "T=two" value.

I've performed the test multiple times with 4.01, 4.12, and 4.20, clearing the registry keys each time.

Only the SETM appears to be broken, writing the value to the CURRENT_USER environment instead of the SYSTEM environment. (In other words, SETM mimics SET). A typo in the command/function name parser sending the SETM request to the SET function??

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#72763 - 2003-01-28 09:33 PM Re: SETM problem in 4.12?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
BTW - This script is part of a server customization process. It adds a directory for admin tools and adds it to the global PATH. Adding it to a specific user's PATH kind of defeats the purpose. It's also the path to where Kix is, so it's CRITICAL for all the rest of the cool scripts to be able to run! [Wink]

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#72764 - 2003-01-28 09:40 PM Re: SETM problem in 4.12?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Do you run the script under a local administrative account?
_________________________
There are two types of vessels, submarines and targets.

Top
#72765 - 2003-01-28 10:13 PM Re: SETM problem in 4.12?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4401
Loc: New Jersey
Yes. My account is a Domain Admin, and I'm in the Admin group on my PC - where I've been testing this today.

I've seen the failure on my XP workstation at home this weekend as well. This is a standard server/workstation customization script that I've used for some time on better than 100 servers here at work. Only after upgrading our deployment copy of Kix did this problem arise.

Here's what we do:

A "Customize" folder has a kixtart.kix file that performs some simple customizations.. edits boot.ini for a 5-second boot delay, creates C:\usr\local\bin folder, copies the contents of CUSTOMIZE\TOOLS there (kix, xnet, blat, psinfo, pslist, pskill), adds that directory to the system path, and defines the prompt. There are a few simple registry additions as well, associating .KIX with notepad, and updating the PATHEXT to include .KIX.

There is a bat file - INST.BAT - that invokes TOOLS\kix32.exe - this automatically invokes the copy of Kix32 that will be copied to the server to perform the copy, and defaults to the kixtart.kix in the same directory as the INST.BAT. It's really simple, and consolidates several functions that used to be done manually.

Ever since I replaced the CUSTOMIZE\TOOLS\kix32.exe with the latest version, the environment values no longer updated properly. Today is the first time I've had a chance to look into the behavior. It's clear that SETM is updating the HKCU\Environment key instad of the HKLM\SYSTEM\CurrentControlSet\Control... key. I've updated my test script to write similar values to the same registry key and that works (wrote TEST_PATH instead of PATH). Registry security is NOT an issue.

Glenn

PS - here's the test script I'm running..
? "@KIX"
set "TEST1=one"
setl "TEST2=two"
setm "TEST3=three"
shell "cmd /c set > x.log"

$ENVKEY = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"

$TMP = "%SYSTEMDRIVE%\usr\local\bin;" + %PATH%
$RTN = WriteValue($ENVKEY, "TEST_PATH", $TMP, "REG_EXPAND_SZ")

After running it, you should see the TEST1 / TEST3 variables in the HKCU\Environment key, when TEST3 should be in the HKLM path. The TEST_PATH is created in the proper location.
_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 1 of 1 1


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

Who's Online
0 registered and 1574 anonymous users online.
Newest Members
BeeEm, min_seow, Audio, Hoschi, Comet
17882 Registered Users

Generated in 0.159 seconds in which 0.123 seconds were spent on a total of 12 queries. Zlib compression enabled.

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