Page 1 of 2 12>
Topic Options
#20434 - 2002-04-23 03:35 PM Insalling package
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
I have created a package using sms installer that i want to push out to certain machine using kix any pointers much apreciated..

code:
$avginst = KeyExist("HKEY_CLASSES_ROOT\Avg.kernel")
If $avginst
? "Avg installed...."

$avg=@SCRIPTDIR+"\avg.exe"
shell "$avg.exe /s"
ENDIF



[ 23 April 2002, 15:36: Message edited by: Stephen Wintle ]
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#20435 - 2002-04-23 03:37 PM Re: Insalling package
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
So, what exactly is the problem? It doesn't get pushed? Are you using it with a login script?
_________________________
There are two types of vessels, submarines and targets.

Top
#20436 - 2002-04-23 03:39 PM Re: Insalling package
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
I want the script to check that the above key is in the reg then run the package...
Steve
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#20437 - 2002-04-23 03:45 PM Re: Insalling package
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
I'm still confused. [Confused] [Confused]
That is exactly what you are doing. Firstly, you check wheter that key exists. Secondly, if the key is found, then you execute the package installation.
So, what is the problem with it? Is it not running? Do you get any error messages when you run that script?
_________________________
There are two types of vessels, submarines and targets.

Top
#20438 - 2002-04-23 04:15 PM Re: Insalling package
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Looks like a syntax problem?

Not sure.. but, should it be:

code:
$avginst = KeyExist("HKEY_CLASSES_ROOT\Avg.kernel")
If $avginst
? "Avg installed...."
SHELL @SCRIPTDIR + "\avg.exe /s"
ENDIF


Top
#20439 - 2002-04-23 04:21 PM Re: Insalling package
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Actually, after doublechecking that.. if you want to install if the key doesn't exist, it should probably be:

code:
IF KeyExist("HKEY_CLASSES_ROOT\Avg.kernel")
? "Avg installed....
ELSE
"SHELL @SCRIPTDIR + "\avg.exe /s"
ENDIF

I'm just guessing, but this checks to see if the key is there, and if it's not it runs the avg.exe silently from the kixtart folder.

Brian

Top
#20440 - 2002-04-23 04:30 PM Re: Insalling package
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
The things Keyexist() returns is changed in oppostition to old Existkey() (3.6X), to the best imho ..

SO finally : if there is a key 'Avg.Kernel' found i presume there is no need to install the package anymore , no ?

Assuming this to be true I would treat it like this (for readability's sake [Big Grin] )

code:
if not keyexist("HKEY_CLASSES_ROOT\Avg.kernel") ;key isn't found
? "installing Avg ..."
$avg=@SCRIPTDIR+"\avg.exe"
shell "$avg.exe /s"
endif

hth

Jochen

[ 23 April 2002, 16:38: Message edited by: jpols ]
_________________________



Top
#20441 - 2002-04-23 04:32 PM Re: Insalling package
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
BrianTX:

I thought that too, at first, but he specifically states that he want to run the package if the key exists:
quote:
I want the script to check that the above key is in the reg then run the package...



[ 23 April 2002, 16:32: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#20442 - 2002-04-23 04:44 PM Re: Insalling package
Jochen Administrator Offline
KiX Supporter
*****

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

if Jens understood that correctly what do you get by running the following :

code:
 
if keyexist("HKEY_CLASSES_ROOT\Avg.kernel") ;key does exist :D
? "Avg installed ..."
$avg = @scriptdir+"\avg.exe"
shell "$avg.exe /s"
"error code is : [" + @error + "] - " + @serror
get $ ;script halted
endif

J.
_________________________



Top
#20443 - 2002-04-23 04:46 PM Re: Insalling package
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Thanks, and yes this is what im trying to do, for some reasom it seems to bypass this part of my script without attempting to install the software, I know my package works...
Thanks for your help so far.
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#20444 - 2002-04-23 04:49 PM Re: Insalling package
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Sorry for the confusion posts are so fast I am replying to the wrong post here's the bottom line,
I want kix to check for the key specified, if not there then... Run my package. Apologies for any confusion!
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#20445 - 2002-04-23 04:49 PM Re: Insalling package
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
HAH !!!!

got it after re-reading (I just copied it w/o recognizing)

you tried to shell (and so did I [Big Grin] ) :

$avg = scriptdir + "\avg.exe"
shell "$avg.exe /s"

won't work , eh ?

[Big Grin]
Jochen
_________________________



Top
#20446 - 2002-04-23 04:56 PM Re: Insalling package
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Ok.. try the code in my first post... I think it may have a chance in heck of working.. assuming that you are trying to run: "avg.exe /s" from the kixtart folder.

Brian

Top
#20447 - 2002-04-23 05:02 PM Re: Insalling package
BrianTX Offline
Korg Regular

Registered: 2002-04-01
Posts: 895
Now, I finally read your last post.. ok.. the first post of code should work if you are installing if the registry key is there. The second post of code should work if you are installing if the registry key is NOT there...

Brian

Top
#20448 - 2002-04-23 05:15 PM Re: Insalling package
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Ok, now this is even more confusing, Brian I used your second post(am logging in with admin rights) on a machine that has the key, it confirms the software is already installed (which it is). However on a machine that dosent have the software it just bypasses the shell command (or seems to) I took the /s switch to make sure I could see an installation.
Is the first " in your second post a mistake (I assumed it was?)

[ 23 April 2002, 17:16: Message edited by: Stephen Wintle ]
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#20449 - 2002-04-23 05:17 PM Re: Insalling package
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Ok, let me put together what we have by now (hope nobody mind me)

Assuming an install if key exists (still see no sense [Wink] )

code:
if keyexist("HKEY_CLASSES_ROOT\Avg.kernel")
shell @scriptdir + '\avg.exe /s'
endif

OR , installing if key isn't found :

code:
if not keyexist("HKEY_CLASSES_ROOT\Avg.kernel")
shell @scriptdir + '\avg.exe /s'
endif

Confused ? Me too [Big Grin]
_________________________



Top
#20450 - 2002-04-23 05:18 PM Re: Insalling package
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Ah yes ,

The " in Brians second reply is a mistake ...
_________________________



Top
#20451 - 2002-04-23 05:22 PM Re: Insalling package
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
So finally you give it away : You install if it isn't yet installed LOL

code:
 if not keyexist("HKEY_CLASSES_ROOT\Avg.kernel")
? 'Installing Avg ...'
shell @scriptdir + '\avg.exe /s'
endif

will do it for you (except the user login in doesn't have the rights to do so [Frown] )

J
_________________________



Top
#20452 - 2002-04-23 05:23 PM Re: Insalling package
Stephen Wintle Offline
Seasoned Scripter

Registered: 2001-04-10
Posts: 444
Loc: England
Jpols u r right to see no sense I was making no sense confused? you will be, no Brian was right the second time, its because i work in a school, they're drive me mental....
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!

Top
#20453 - 2002-04-23 05:24 PM Re: Insalling package
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
ROFLMAO !
_________________________



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
1 registered (Allen) and 1198 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.078 seconds in which 0.028 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