Page 1 of 1 1
Topic Options
#206573 - 2013-01-18 03:03 AM Bug with KeyExist?
Gaven Offline
Starting to like KiXtart
*

Registered: 2003-06-19
Posts: 103
Loc: Washinton DC, USA
I'm using KiXtart to determine if the workstation has Altiris (a Syamntec workstation management solution) pointing to an old server and if it does it uninstalls and then installs the new version. The script will also install the agent if no agent is installed. I'm using the "KeyExist" KiXtart Function to check if it's installed at all and it keeps reporting the key exists - even when it does not. What's really odd is I tested with a random string and it reports that key does not exist. In other words....

KeyExist("HKLM\Software\Altiris")
- will return a "1" even if the key does not exist

KeyExist("HKLM\Software\dfyjhr7j7565j76")
- will return a "0" which is accurate

The custom function I'm running is pretty simple:

Function SwitchAltiris($old,$uninstall,$install)
If ReadValue("HKLM\Software\Altiris\Altiris Agent\Servers","")=$old
Shell $uninstall
Sleep 30
EndIf
If KeyExist("HKLM\Software\Altiris")=0
Shell $install
EndIf
EndFunction

Any idea why KiXtart is reporting the non-existant key exists?

FYI - I get a false positive even if the key does not exist when the script is executed.

Top
#206574 - 2013-01-18 05:35 AM Re: Bug with KeyExist? [Re: Gaven]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Are they 64-bit systems? Does the key exist in 'HKLM\Software\Wow6432node\altiris' ?
Top
#206575 - 2013-01-18 05:37 AM Re: Bug with KeyExist? [Re: ShaneEP]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
My laptop reported a 0 when I first tried. Then I added the key to the tree I mentioned above...It then reported a 1.....Even though it still doesnt exist in 'HKLM\Software\altiris'

Edited by ShaneEP (2013-01-18 05:37 AM)

Top
Page 1 of 1 1


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

Who's Online
0 registered and 2312 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.22 seconds in which 0.158 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