Page 1 of 1 1
Topic Options
#13615 - 2001-10-26 02:36 PM KeyExist Help
Anonymous
Unregistered


7th day and kix scripting and counting I'd like to thank kixtart.org first, they've supplied answers to many of my initial questions..especially the posters on this board (ie "searching").

I'd like for it to search for the Adobe reg key, and if not present install Adobe...but it's JUST NOT WORKING...it always runs the .exe no the outcome. Some help would be surely appreciated.

;Look for Adobe, if not installed install it...

$AKey = KeyExist ("HKEY_LOCAL_MACHINE\SOFTWARE\Adobe")
IF @ERROR = 1
? "Adobe is present.."
GOTO IEINSTALL

ELSE ;Adobe is not present, install it....
RUN "\\Elmo\Common\Software\Applications\Acrobat Reader\rs405eng.exe"
Sleep ( 20 )
Setfocus ("Acrobat Reader 4.05 Setup")
Sendkeys ("{ENTER} {ENTER}")
Sleep ( 10 )
Sendkeys ("{ENTER}")

:IEINSTALL

Top
#13616 - 2001-10-26 02:58 PM Re: KeyExist Help
Jochen Administrator Offline
KiX Supporter
*****

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

try out the following :

code:

if KeyExist("HKEY_LOCAL_MACHINE\SOFTWARE\Adobe")
"Adobe is present.."
GOTO IEINSTALL
endif

; Your Adobe installation here

:IEINSTALL


J.

[ 26 October 2001: Message edited by: jpols ]

_________________________



Top
#13617 - 2001-10-26 03:16 PM Re: KeyExist Help
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
in Kixtart v3.6x (Kix95) ExistKey returns a 0 if a key is found and a 2 if a key is not found.

In Kixtart v4.0 (Kix2001) ExistKey is replaced by KeyExist and returns a 1 if the key is found and a 0 if the key is not found.

The v4.0 method is comparable (<-is that a word) with the EXIST function, that's why Ruud changed it.

[ 26 October 2001: Message edited by: DrillSergeant ]

_________________________
The Code is out there

Top
#13618 - 2001-10-26 03:22 PM Re: KeyExist Help
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Now,
that's what I call cooperation .... Code from my side explanation from the Sarge !

Anything else ?

J.

_________________________



Top
#13619 - 2001-10-26 03:26 PM Re: KeyExist Help
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
BTW:


ExistKey still works the same in Kix 4.0, so it is backwards compatible.

The function isn't described in the manual though.
<EDIT>
Whoops, it is in the manual, it isn't in the CHM file.
</EDIT>

[ 26 October 2001: Message edited by: DrillSergeant ]

_________________________
The Code is out there

Top
#13620 - 2001-10-27 02:30 AM Re: KeyExist Help
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Indeed all kind of additional documentation exist, but sometimes a little
conversion problem was introduced.
Our primary source is always the original documentation of Ruud van Velsen,
which is distributed by kixtart releases.


Currently we are reviewing the latest documentation version of kixtart RC3 release.
So we will take also look at the chm version of scriptlogic. It is
the one compliant with this release.
greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#13621 - 2001-10-27 03:05 AM Re: KeyExist Help
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
Yes, comparable is a word and it was used and spelled correctly also.
Top
#13622 - 2001-10-27 05:20 AM Re: KeyExist Help
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

An idea to prevent misunderstanding the meaning of a value is using symbolic
names for them.
F.e.

- $_program_group_added_successfull=0
- $_program_item_added_successfull=0
- $_eventlog_backed_up_successfull=0
- $_eventlog_cleared_successfull=0
- $_file_closed_successfull=0
- $_subkey_deleted_successfull=0
- $_printer_connection_deleted_successfull=0
- $_program_group_deleted_successfull=0
- $_program_item_deleted_successfull=0
- $_subkey_deleted_successfull=0
- $_value_entry_deleted_successfull=0
- $_dir_successfull=0
- $_file_found=1 ; Exist
- $_file_not_found=0 ; Exist
- $_member_of_group=1 ; Ingroup
- $_no_member_of_group=0 ; Ingroup
- $_no_keystroke_in_keyboard_buffer=0
- $_subkey_found=1 ; KeyExist
- $_subkey_not_found=0 ; KeyExist
- $_hive_key_loaded_successfull=0
- $_subkey_loaded_successfull=0
- $_event_logged_successfull=0
- $_user_logged_off_successfull=0
- $_file_opened_successfull=0
- $_line_read_successfull=0
- $_profilestring_read_successfull=0
- $_subkey_type_found_successfull=0
- $_value_read_successfull=0
- $_output_redirected_successfull=0
- $_subkey_saved_successfull=0
- $_keystrokes_send_successfull=0
- $_message_sent_successfull=0
- $_display_state_changed_successfull=0
- $_default_printer_set_successfull=0
- $_attributes_set_successfull=0
- $_focus_set_successfull=0
- $_setsystemstate_action_successfull=0
- $_title_set_successfull=0
- $_wallpaper_set_successfull=0
- $_program_group_viewed_successfull=0
- $_computer_shutdown_successfull=0
- $_hive_key_unloaded_successfull=0
- $_line_write_successfull=0
- $_profilestring_written_successfull=0
- $_value_written_successfull=0

The functions Exist, Ingroup and KeyExist will return
a 1 when action is successfull.
An example:

code:

$_subkey_found=1 ; KeyExist
$_subkey_not_found=0 ; KeyExist
;
$key="HKCU\MCA"
IF (KeyExist($key) = $_subkey_found)
? $ikey+" found."
ELSE
? $ikey+" not found."
ENDIF


Such symbolic names make it easily to move your code from ExistKey
to KeyExist.

[/code]
greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#13623 - 2001-10-28 11:17 AM Re: KeyExist Help
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
MCA,

Not sure if it applies, but I thought there was a 14 character limit to variables.

Your examples appear to extend beyond this, or is 2001 RC3 different? Or is this some other type of declare?

Top
#13624 - 2001-10-28 06:07 PM Re: KeyExist Help
Anonymous
Unregistered


I think you should have a look at www.installshield.com to get knowledge of how to create a silent install with installshield.
Which makes it easier and you don't need to use that setfocus thing.

Unextract and use setup -r to create an setup.iss file in %WINDIR% folder. Copy that to the extracted folder and next time run
setup /s instead of setup. Then it uses the recorded setup.iss file for silent install.

Fabian

Top
#13625 - 2001-10-30 01:04 AM Re: KeyExist Help
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear NTDOC,

We had extend the above list of symbolic names for error codes for
version kix2001 version. For the earlier version we are using a
small set of it and we take the variable name length into account.
greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#13626 - 2001-10-30 02:57 PM Re: KeyExist Help
Anonymous
Unregistered


Aaah!

I tried some of the ideas, and nothing seems to be working.

if KeyExist("HKEY_LOCAL_MACHINE\SOFTWARE\Adobe")
"Adobe is present.."
GOTO IEINSTALL
endif
; Your Adobe installation here

:IEINSTALL

With this statement courtesy of jpols, even if I change the actual Adobe key in the registry it will always continue with the GOTO IEINSTALL...maybe I'm doing something wrong here.

AACK!

Top
#13627 - 2001-10-30 03:27 PM Re: KeyExist Help
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
you will need to exit() the script before you reach the install process.

Or do something like this.

code:

if KeyExist("HKEY_LOCAL_MACHINE\SOFTWARE\Adobe")
;do nothing!!
"Adobe is present.."
Else
; Your Adobe installation here

endif


Bryce

Top
#13628 - 2001-10-30 09:51 PM Re: KeyExist Help
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Can you run following script and put the result on the board. It is verified for
kixtart 2001 RC 3 release.

code:

?
? "-KeyExist verify-"
?
$ikey="HKEY_CURRENT_USER\Software"
? "(1=exist/0=not exist) "+KeyExist($ikey+"\MCA")

IF (AddKey($ikey+"\MCA") <> 0)
? "AddKey @error (@serror)"
ELSE
? "AddKey completed."
ENDIF
? "(1=exist/0=not exist) "+KeyExist($ikey+"\MCA")

IF (DelKey($ikey+"\MCA") <> 0)
? "DelKey @error (@serror)"
ELSE
? "DelKey completed."
ENDIF
? "(1=exist/0=not exist) "+KeyExist($ikey+"\MCA")
?
? "-ExistKey verify-"
?
? "(0=exist/1=not exist) "+ExistKey($ikey+"\MCA")

IF (AddKey($ikey+"\MCA") <> 0)
? "AddKey @error (@serror)"
ELSE
? "AddKey completed."
ENDIF
? "(0=exist/1=not exist) "+ExistKey($ikey+"\MCA")

IF (DelKey($ikey+"\MCA") <> 0)
? "DelKey @error (@serror)"
ELSE
? "DelKey completed."
ENDIF
? "(0=exist/1=not exist) "+ExistKey($ikey+"\MCA")



The output was:
code:

-KeyExist verify-

(1=exist/0=not exist) 0
AddKey completed.
(1=exist/0=not exist) 1
DelKey completed.
(1=exist/0=not exist) 0

-ExistKey verify-

(0=exist/1=not exist) 2
AddKey completed.
(0=exist/1=not exist) 0
DelKey completed.
(0=exist/1=not exist) 2


greetings.


btw: the result of 2 for ExistKey is not conform documentation. be aware of that.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#13629 - 2001-10-31 08:37 AM Re: KeyExist Help
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

Can you run also our script software.kix which you can find on our site http://home.wanadoo.nl/scripting
It is reading all registry software registry keys to create a list of installed software.
When you have still a problem can you put the output of this script on the board.
The debug file will be c:\kix-info.log.

btw: symbol on our homepage has been linked to related http://kixtart.org topic.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#13630 - 2001-10-31 09:03 AM Re: KeyExist Help
Anonymous
Unregistered


I did a Redirectouput and here's exactly what I got. Also did a @kix and I'm running Kix 3.63. I'll give that software kix script a try and see what I get...maybe I can leech some ideas

Reverend "Rollin Hard" Love

code:

-KeyExist verify-

(1=exist/0=not exist) KeyExistHKEY_CURRENT_USER\Software\MCA
AddKey completed.
(1=exist/0=not exist) KeyExistHKEY_CURRENT_USER\Software\MCA
DelKey completed.
(1=exist/0=not exist) KeyExistHKEY_CURRENT_USER\Software\MCA

-ExistKey verify-

(0=exist/1=not exist) 2
AddKey completed.
(0=exist/1=not exist) 0
DelKey completed.
(0=exist/1=not exist) 2



Top
#13631 - 2001-11-01 07:33 AM Re: KeyExist Help
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

We have modify your code for kixtart 3.36

code:

;Look for Adobe, if not installed install it...
IF (ExistKey("HKEY_LOCAL_MACHINE\SOFTWARE\Adobe") <> 0) ; - software not installed -
;Adobe is not present, install it....
RUN '%comspec% /c "\\Elmo\Common\Software\Applications\Acrobat Reader\rs405eng.exe" '
SLEEP 20
$nul=Setfocus("Acrobat Reader 4.05 Setup")
$nul=Sendkeys("{ENTER} {ENTER}")
SLEEP 10
$nul=Sendkeys("{ENTER}")
ELSE
? "Adobe is present.."
ENDIF

Some remarks:

  • modify KeyExist to ExistKey.
  • insert %comspec% /c in your RUN call.
  • remove GOTO structure.
  • add $nul= to your function to prevent unnecessary screen output.

greetings.


btw: it was very interesting to see how kixtart 3.63 was handling the unknown
function KeyExist.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#13632 - 2001-11-01 07:50 AM Re: KeyExist Help
Anonymous
Unregistered


Thanks! Everyone has been very patient and helpful....good message board

Reverend Love

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 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

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