indycolt
(Fresh Scripter)
2003-08-14 04:28 PM
IF ELSE GOTO problems

Could someone please tell me what I'm doing wrong? The below script always installs IE6 and I only want it to install if the version number is not 6.0.2800.1106

Thanks

$regkey = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\iexplore.exe"
$iexplore = READVALUE($regkey,"")
$iever = GETFILEVERSION($iexplore)

?$iever

IF $iever = "6.0.2800.1106"
GOTO END
ELSE
GOTO IEINST
ENDIF

:IEINST
; *IE6 Install*
? "** Processing.... Please Wait **"
RUN \\server\SYSVOL\home.com\scripts\ie6setup.bat

:END
exit


JochenAdministrator
(KiX Supporter)
2003-08-14 04:39 PM
Re: IF ELSE GOTO problems

the string extract is correct ...

you may want to get rid of this goto stuff though by specifying a clear condition like

code:
if $iever = "6.0.2800.1106"
quit 1
else
;do your install here
endif

You miss of course the quotes around your RUN string, so I have to wonder why it installs anyway [Confused]


JochenAdministrator
(KiX Supporter)
2003-08-14 04:41 PM
Re: IF ELSE GOTO problems

this should work as well :
code:
  
if $iever < "6.0.2800.1106"
;install it
endif



JochenAdministrator
(KiX Supporter)
2003-08-14 04:44 PM
Re: IF ELSE GOTO problems

You may as well follow the suggestions by Rad and Les in your other topic [Wink]